Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Timeout Question
Timeout Question [message #490679] Fri, 09 October 2009 16:51 Go to next message
Bhooshan Mogal is currently offline Bhooshan MogalFriend
Messages: 16
Registered: July 2009
Junior Member
Hi All,

I have been setting the timeout for some of my tests (in which I know some widgets take time to load) to a higher value. However, this seems to slow down my entire test suite. If this is indeed expected behavior, can anybody point me to how I can set a higher timeout only in places where I know widgets take longer to load, and the speed of execution of the rest of my tests remains the same? Any examples would be really helpful.

Thanks,
Bhooshan
Re: Timeout Question [message #490680 is a reply to message #490679] Fri, 09 October 2009 16:53 Go to previous messageGo to next message
Bhooshan Mogal is currently offline Bhooshan MogalFriend
Messages: 16
Registered: July 2009
Junior Member
sorry... duplicate thread...
Re: Timeout Question [message #490784 is a reply to message #490679] Sat, 10 October 2009 16:11 Go to previous message
Ketan Patel is currently offline Ketan PatelFriend
Messages: 68
Registered: July 2009
Member
I don't know exactly what you want to do but if you are talking about the default timeout SWTBot uses to find widgets, i.e. waitUntil method, then you can do something like following:

long origTimeout = SWTBotPreferences.TIMEOUT; // save current timeout
try {
  SWTBotPreferences.TIMEOUT = 30000; // set new timeout of 30 seconds
  bot.text(); // whatever you want to find which is taking long time
} finally {
  SWTBotPreferences.TIMEOUT = origTimeout; // restore saved timeout after done
}


The above shows how to change timeout for finding one text widget but you can do it for each test, using @Before and @After in Junit, or class, using @BeforeClass and @AfterClass. You save the timeout value in Before and restore it in @After. This would mean all the widgets for this class will timeout after what you have set.
Previous Topic:TImeout Question
Next Topic:Clicking menu item in view toolbar button's drop down
Goto Forum:
  


Current Time: Thu Mar 28 11:49:45 GMT 2024

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

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

Back to the top