Skip to main content



      Home
Home » Eclipse Projects » SWTBot » Timeout Question
Timeout Question [message #490679] Fri, 09 October 2009 12:51 Go to next message
Eclipse UserFriend
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 12:53 Go to previous messageGo to next message
Eclipse UserFriend
sorry... duplicate thread...
Re: Timeout Question [message #490784 is a reply to message #490679] Sat, 10 October 2009 12:11 Go to previous message
Eclipse UserFriend
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 Jun 12 09:48:38 EDT 2025

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

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

Back to the top