GNOME Bugzilla – Bug 628623
ldtp.hasstate doesn't report focused immediately after ldtp.activate
Last modified: 2010-09-09 09:10:33 UTC
ldtp.hasstate for some applications (e.g. gnome-terminal) never shows state.FOCUSED even if the application is focused and even immediately after wnck focus or ldtp.activatewindow('frmTerminal') steps to reproduce: python >>>import ldtp >>>ldtp.hasstate('frmTerminal','txt0',ldtp.state.FOCUSED) 0 >>>ldtp.activate('frmTerminal') 1 >>>ldtp.hasstate('frmTerminal','txt0',ldtp.state.FOCUSED) 0
Looks like the FOCUSED state doesn't exist in frame / dialog level. When checked with accerciser, I could not see the FOCUSED state. Its either bug in application or the functionality limitation. Its not bug in LDTP. Closing the bug. Thanks
Thanks Nagappan. That sounds like a test case I should add the a11y testbot. Something like: activatewindow({frame of application}) Either frmTerminal (or a dialog child? or _ANY_ focusable child???) should have state.FOCUSED
(In reply to comment #2) > activatewindow({frame of application}) > Either frmTerminal (or a dialog child? or _ANY_ focusable child???) should > have state.FOCUSED I noticed state.ACTIVE is appropriate in Window level, just give a try with this: >>> from ldtp import * >>> hasstate('frmTerminal', 'frmTerminal', state.ACTIVE) # Terminal in focus 1 >>> wait(2);hasstate('frmTerminal', 'frmTerminal', state.ACTIVE) # Terminal *not* in focus 1 0 >>> wait(2);hasstate('frm*-gedit', 'frm*-gedit', state.ACTIVE) # Gedit *not* in focus 1 0 >>> wait(2);hasstate('frm*-gedit', 'frm*-gedit', state.ACTIVE) # Gedit in focus 1 1 Thanks
Yes I've tried all of these and they work just as you indicated they should. Should active windows always have one and only one child with state focused?