Close and open the workbench in a test [message #521883] |
Fri, 19 March 2010 03:02  |
Eclipse User |
|
|
|
Hi,
I am trying to evaluate SWTBot for automating the eclipse related tests.
Most of my tests require require closing and opening the workbench during the test. Does any one know how this can be achieved?
I tried the using the restart(File->Restart) option available in eclipse but after restarting, the test starts executing from the beginning.
myTest()
{
doThis_1;
bot.menu("File").menu("Restart").click(); // after restarting the test starts executes the statement "do_This_1" instead of "do_This_2"
doThis_2;
}
I would really appreciate any workaround/suggestion to this problem.
Thanks,
Mohsin
|
|
|
|
Re: Close and open the workbench in a test [message #559972 is a reply to message #554994] |
Mon, 20 September 2010 11:09  |
Eclipse User |
|
|
|
Hi,
In my tests I need to restart the workbench too. I noticed that the test runs from the beginning after the restart, so I did a "control file" that I can read this file and know where I left the test.
During the execution of the test, I write some codes in the file, like numbers, and then I read and compare the code. For example:
myTest()
{
if(readCodeFromFile() == 0)
doThis_1;
else
doThis_2;
writeInFile(1);
bot.menu("File").menu("Restart").click();
if(readCodeFromFile() == 1)
doThis_3;
else
doThis_4;
writeInFile(2);
}
I tried to switch the workspace too, but I could not do it. I tried to click on File->Switch Workspace, but it did not work.
If someone knows how to do it, please let us know.
Hope it helps.
Victor
|
|
|
Powered by
FUDForum. Page generated in 0.24271 seconds