Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to refresh window list immediately #10

Open
yilang2007lw opened this issue Jul 18, 2014 · 7 comments
Open

How to refresh window list immediately #10

yilang2007lw opened this issue Jul 18, 2014 · 7 comments
Assignees

Comments

@yilang2007lw
Copy link

Hi, I am using ldtp to test cinnamon system settings for linuxmint, but I found the getwindowlist method sometimes don't refresh the window title even though it changed actually. When I click the background icon by generatemouseevent, the getwindowlist method should return 'frmBackgrounds' but it still return 'frmSystemSettings' for me, waittillguiexist does't take effect.Is this a bug or there has some method I don't know to refresh the window title, thanks for any reply.

yilang

@nagappan
Copy link
Member

What happens when you try this with accerciser ? If the behavior is NOT same, then there is some issue on LDTP side, else you can try calling remap() function and see if that helps.

@yilang2007lw
Copy link
Author

I can't try that with accerciser because accerciser's UI blocked heavily.I think this is ldtp's problem. Because when I test in ipython shell, the returned window title was wrong(should return 'frmBackgrounds but returned 'frmSystemSettings'), but when I exit the ipython and enter ipython and import ldtp again, the window title was correct.
The remap function doesn't take effect as it is used to refresh the content of a window, don't include the window's property itself.And also, when I launch and exit cinnmon-settings multiple times, the getapplist function returned wrong(It return many 'cinnmon-settings' items but there is actually no cinnamon-settings process exists any more)
I remember these has a method named 'setcontext' in the old ldtp version, but it doesn't exist any more,any other way to solve the problem?
Thanks for youre reply, I think you can have a try in your distribution's system control center, I think you can easily reproduce the problem.

@yilang2007lw
Copy link
Author

Hi nagappan, I get the solution is import ldtp in my each function independently, not import ldtp with whole module or class. I think this is bug of ldtp for cache mechanism, it should listen the accessible object name change event. I had try some code with libatspi's c api, there is no problem, but also the performance is not very good.If you have some solution for any of the problem, please reply me, thanks very much.

@nagappan
Copy link
Member

Can you please provide me sample script to reproduce the issue ? What Linux distribution you are trying with ?

@yilang2007lw
Copy link
Author

The solution upstair takes no effect as del ldtp module and then import it again brings other problems, so I give up to join my ldtp's action together. I test each gui operation one by one now, then there shouldn't have window title change.Sorry for my post and bad english.

I use linuxmint-17-cinnamon-64bit-v2,you can show the problem like this:

  1. Start ipython, type "import ldtp", then type "ldtp.launchapp('cinnamon-settings')"
    2.When launch finish, type "ldtp.getwindowlist()", you will see 'frmSystemSettings' in the output.
    3.Then switch to the cinnamon-settings app, click the 'background' icon, wait till load Backgrounds module finish.
    4.Go back to ipython shell, then type "ldtp.getwindowlist()", at the moment, the output should contain 'frmBackgrounds' , but it still print me 'frmSystemSettings'.

That's all, I think you can easily repeat this problem in your distribution as many distribution have an app like system settings, thanks verymuch.

@nagappan
Copy link
Member

nagappan commented Aug 6, 2014

John, Can you please take a look at this ? Thanks

@cherryliu1992
Copy link

cherryliu1992 commented Sep 19, 2019

I maybe have the same issue, do you have any solution ever

I cannot grab focus on the new object when the window refresh to show new objects though this object is in appmap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants