Timeout Question [message #490679] |
Fri, 09 October 2009 12:51  |
Eclipse User |
|
|
|
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 #490784 is a reply to message #490679] |
Sat, 10 October 2009 12:11  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.26769 seconds