Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Jubula » How to check which Tabbed Component is currently active?
How to check which Tabbed Component is currently active? [message #1408666] Fri, 15 August 2014 18:38 Go to next message
David Hickernell is currently offline David HickernellFriend
Messages: 82
Registered: October 2012
Member
I have a test case wherein I want to click on a particular Tabbed Component, but only if that pane is not already the active one (receiving keyboard input). Unfortunately, using "Check Focus" on a Tabbed Component always seems to return false. In this case, it does not matter which tab is selected in the pane, I just want to check whether that pane contains the widget that currently has the input focus.

Does anyone know of a way to do this? I have also tried Get Property with the property "focusControl", but the result is the same: always false, regardless of what is selected.
Re: How to check which Tabbed Component is currently active? [message #1409468 is a reply to message #1408666] Mon, 18 August 2014 07:17 Go to previous messageGo to next message
Alexandra Schladebeck is currently offline Alexandra SchladebeckFriend
Messages: 1298
Registered: July 2009
Senior Member
Hi David,

Are you running the tests on a Mac? I have some recollection about check focos not working correctly for one of the toolkits (I think SWT/RCP) on a Mac.
At any rate - if you know the text / index of the tab you want selected, then you could use the actions "check selection of tab by value" or "... by index" to first check whether the tab you want is selected and, if not, select it with a retry event handler.

Hope that helps!
Alex
Re: How to check which Tabbed Component is currently active? [message #1409649 is a reply to message #1409468] Mon, 18 August 2014 16:11 Go to previous messageGo to next message
David Hickernell is currently offline David HickernellFriend
Messages: 82
Registered: October 2012
Member
Hi Alex,
I'm running in 64-bit Linux.

I would do exactly what you're saying, but it doesn't work when the tab I'm looking for is the one selected in the pane I want, and the focus is in another pane. "Check Selection of Tab by Value" still returns "true" in that case.

Thank you though!
Re: How to check which Tabbed Component is currently active? [message #1409849 is a reply to message #1409649] Tue, 19 August 2014 05:57 Go to previous messageGo to next message
Alexandra Schladebeck is currently offline Alexandra SchladebeckFriend
Messages: 1298
Registered: July 2009
Senior Member
Thanks for the clarification David. I've not come across this kind of situation before - could you sketch / show what the situation looks like?
Re: How to check which Tabbed Component is currently active? [message #1410085 is a reply to message #1409849] Tue, 19 August 2014 19:49 Go to previous messageGo to next message
David Hickernell is currently offline David HickernellFriend
Messages: 82
Registered: October 2012
Member
It's basically a normal Eclipse window, with several tabbed panes, each of which may have more than one tab in it. Using Ctrl-PageDown, I can navigate through whichever tab deck has the input focus.

I want to end up at Tab A, which is currently at the front of Pane B, but the input focus is in Pane C. So if I check to see if Tab A is selected, it will return "true", but Ctrl-PageDown will still cycle through Pane C instead of Pane B.
Re: How to check which Tabbed Component is currently active? [message #1410231 is a reply to message #1410085] Wed, 20 August 2014 06:56 Go to previous messageGo to next message
Alexandra Schladebeck is currently offline Alexandra SchladebeckFriend
Messages: 1298
Registered: July 2009
Senior Member
Now I get it Smile The tab you want selected is indeed selected. But the focus isn't in that pane so it doesn't help for your Ctrl+PageDown. My suggestion at this point would be to see if there is another component in the panes that you can use to gauge where the focus is - could that help?

Best regards,
Alex
Re: How to check which Tabbed Component is currently active? [message #1410374 is a reply to message #1410231] Wed, 20 August 2014 15:28 Go to previous message
David Hickernell is currently offline David HickernellFriend
Messages: 82
Registered: October 2012
Member
Well, there are several components in each tab that might have the focus, and I execute this case much too frequently to want to brute-force it. At this point, I think the easiest way is just to go case-by-case and make sure that I explicitly click on the tab deck I want before navigating, and forget the focus check altogether. Smile Thank you!
Previous Topic:Jubula not saving my testreports
Next Topic:Automated Testing via Scheduled Task. Autrun.exe not starting
Goto Forum:
  


Current Time: Sun Mar 29 04:51:03 GMT 2015

Powered by FUDForum. Page generated in 0.01993 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software