Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Close and open the workbench in a test(How to close and open the workbench while running a test?)
Close and open the workbench in a test [message #521883] Fri, 19 March 2010 03:02 Go to next message
Mohsin  is currently offline Mohsin
Messages: 5
Registered: March 2010
Junior Member
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 #554994 is a reply to message #521883] Wed, 25 August 2010 02:46 Go to previous messageGo to next message
Tim S is currently offline Tim S
Messages: 7
Registered: August 2010
Junior Member
I'm also wondering if there's a way to achieve this. If anyone has an idea, please share!
Re: Close and open the workbench in a test [message #559972 is a reply to message #554994] Mon, 20 September 2010 11:09 Go to previous message
Victor  is currently offline Victor
Messages: 16
Registered: June 2010
Junior Member
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
Previous Topic:GEF GraphicalViewer within a dialog
Next Topic:InvalidThreadAccess when starting SWTBot in headless mode
Goto Forum:
  


Current Time: Fri Aug 01 09:59:14 EDT 2014

Powered by FUDForum. Page generated in 0.01621 seconds