Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » SWTBot couldn't find widget -- random
SWTBot couldn't find widget -- random [message #667517] Fri, 29 April 2011 06:17 Go to next message
shawn  is currently offline shawn
Messages: 9
Registered: February 2011
Junior Member
Hi, could someone give me a help ?

I'm using swtbot to test a RCP application, but I got a big problem ...
swtbot sometimes couldn't find a simple widget, like "Text", "Menu" ...

I wrote this :
bot.menu("label").click(); ...
bot.textWithLabel("label").setText("...");
sometimes, these work well, but sometimes will throw "Widget not found exception.." Sad
I did nothing when running swtbot and kept the rcp application in front and focus on
Re: SWTBot couldn't find widget -- random [message #668561 is a reply to message #667517] Fri, 06 May 2011 04:55 Go to previous messageGo to next message
Felix Lu is currently offline Felix Lu
Messages: 12
Registered: April 2011
Junior Member
You can use the waitUntil() method to ensure that the dialog has been opened.

bot.waitUntil(new DefaultCondition() {
			public boolean test() {
				return SOME_CONDITION;
			}
			public String getFailureMessage() {
				return "Dialog XXX not opened.";
			}
		});
Re: SWTBot couldn't find widget -- random [message #674180 is a reply to message #668561] Wed, 25 May 2011 23:27 Go to previous messageGo to next message
shawn  is currently offline shawn
Messages: 9
Registered: February 2011
Junior Member
Yeah, tried with your help ..
but just sometimes will work .. strange !
however, thanks for your reply !
Re: SWTBot couldn't find widget -- random [message #676930 is a reply to message #667517] Mon, 06 June 2011 22:07 Go to previous message
Lycos  is currently offline Lycos
Messages: 1
Registered: June 2011
Junior Member
If you perform multiple test cases, previous test case can have an impact on next test cases.
For example, previous test case fails. so, opened dialog box was not closed.
when you perform the next test cases, the dialog box still remains.
Previous Topic:Not able to launch my plugin application with bot
Next Topic:How to navigate through various tabs in Eclipse search menu
Goto Forum:
  


Current Time: Sat Aug 02 04:50:36 EDT 2014

Powered by FUDForum. Page generated in 0.02651 seconds