Skip to main content



      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
Eclipse UserFriend
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
Eclipse UserFriend
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
Eclipse UserFriend
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: Tue Jul 22 19:39:31 EDT 2025

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

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

Back to the top