Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » pause in my swtbot's test
pause in my swtbot's test [message #26415] Thu, 05 March 2009 15:17 Go to next message
Brice Laurel is currently offline Brice Laurel
Messages: 72
Registered: July 2009
Member
Hi list,

I read FAQ http://wiki.eclipse.org/SWTBot/FAQ.

I write the test below

public void testMenuFileNew() throws Exception {
bot.menu("File").click();
Thread.sleep(1000);
bot.menu("New").click();
Thread.sleep(1000);
}

The execution run good but I want to click on "File", stay one second,
after click on "New", wait another one second. But Test run so speed.

What I can do it?

Thanks in advance for your help.
Re: pause in my swtbot's test [message #26481 is a reply to message #26415] Thu, 05 March 2009 16:56 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan Padegaonkar
Messages: 873
Registered: July 2009
Senior Member
Hi Brice

I've updated the FAQ to use the correct property names now. Please refer
to the faq [1] again.

If you need to slow down all your tests you can set the system property
"org.eclipse.swtbot.playback.delay" to a number of your choice, a value
of 10-20 should be good enough for most people, any higher and you'll
get bored staring at the screen :)

[1] -
http://wiki.eclipse.org/SWTBot/FAQ#Can_I_slow_down_the_execu tion_speed_of_SWTBot_tests.3F

-- Ketan

On 5/3/09 20:47, Brice Laurel wrote:
> Hi list,
>
> I read FAQ http://wiki.eclipse.org/SWTBot/FAQ.
>
> I write the test below
>
> public void testMenuFileNew() throws Exception {
> bot.menu("File").click();
> Thread.sleep(1000);
> bot.menu("New").click();
> Thread.sleep(1000);
> }
>
> The execution run good but I want to click on "File", stay one second,
> after click on "New", wait another one second. But Test run so speed.
>
> What I can do it?
>
> Thanks in advance for your help.
>
Re: pause in my swtbot's test [message #26595 is a reply to message #26481] Fri, 06 March 2009 04:38 Go to previous messageGo to next message
Brice Laurel is currently offline Brice Laurel
Messages: 72
Registered: July 2009
Member
Hi Ketan,

L write this class

public class FileTest extends TestCase {

public SWTEclipseBot bot;

public void setUp()throws Exception {
super.setUp();
bot = new SWTEclipseBot();
}

public void tearDown()throws Exception {

super.tearDown();
}

public void testMenuFileNew() throws Exception {
System.setProperty("org.eclipse.swtbot.search.timeout", "30000");
bot.menu("File").menu("New").click();
System.setProperty("org.eclipse.swtbot.search.timeout", "30000");
}
}

But When I run this, the execution is so speed. I want that, whenI click
on menu File -> New, I wait five(5) seconds before I continue with test.

What it wrong in my test to do what I want to do ?

Thanks in advance for your help.
Re: pause in my swtbot's test [message #26616 is a reply to message #26595] Fri, 06 March 2009 05:06 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan Padegaonkar
Messages: 873
Registered: July 2009
Senior Member
On 6/3/09 10:08, Brice Laurel wrote:
> But When I run this, the execution is so speed. I want that, whenI click
> on menu File -> New, I wait five(5) seconds before I continue with test.

I suppose you're referring to the fact that eclipse shuts down by the
time the menu is clicked, and therefore you don't notice anything and
you want to wait 5 secs before eclipse shuts down.

There's an option in the run config dialog to keep junit running after
the launch, or add a sleep after the test is completed.

-- Ketan
Re: pause in my swtbot's test [message #26659 is a reply to message #26616] Fri, 06 March 2009 09:18 Go to previous messageGo to next message
Brice Laurel is currently offline Brice Laurel
Messages: 72
Registered: July 2009
Member
Thanks Ketan,

That is what I want to do.

I open the run configuration of my Eclipse IDE. But I can't do what I want
to do (wait 5 seconds after an action with swtbot). I search on google,
but I find nothing.

Can you help me to do this?

Thanks in advance for your help.
Re: pause in my swtbot's test [message #26700 is a reply to message #26659] Fri, 06 March 2009 09:44 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan Padegaonkar
Messages: 873
Registered: July 2009
Senior Member
http://wiki.eclipse.org/Image:Run-as-config-create.jpg

There's a checkbox 'keep junit running...'

-- Ketan

On 6/3/09 14:48, Brice Laurel wrote:
> Thanks Ketan,
>
> That is what I want to do.
>
> I open the run configuration of my Eclipse IDE. But I can't do what I
> want to do (wait 5 seconds after an action with swtbot). I search on
> google, but I find nothing.
>
> Can you help me to do this?
>
> Thanks in advance for your help.
>
Re: pause in my swtbot's test [message #26945 is a reply to message #26700] Sat, 07 March 2009 08:43 Go to previous message
Brice Laurel is currently offline Brice Laurel
Messages: 72
Registered: July 2009
Member
Thanks Ketan,

I went to my run configuration :

1- I choose Test runner: Junit3
2- I check "Keep JUnit after a test run when debugging"

I use eclipse 3.4 and SWTBot 2.0.

Now, when I execute my testCase below

public class FileTest extends TestCase {

public SWTEclipseBot bot;

public void setUp()throws Exception {
super.setUp();
bot = new SWTEclipseBot();
}

public void tearDown()throws Exception {

super.tearDown();
}

public void testMenuFileNew() throws Exception {
SWTBotMenu menuFile = bot.menu("File");
menuFile.click();
System.setProperty("org.eclipse.swtbot.search.timeout", "5000");
SWTBotMenu menuFileNew = menuFile.menu("New");
System.setProperty("org.eclipse.swtbot.search.timeout", "5000");
menuFileNew.click();
}
}

I don't have what I want.

I want to do this:
1- "swtbot" click on menu "File", wait 5 seconds
2- "swtbot" click on submenu "New" wait 5 seconds and so one...

I want to visualize any step of my test.

Thanks in advance for your help
Previous Topic:Help Shell Not Found on Windows
Next Topic:Improvement for captureScreenshot
Goto Forum:
  


Current Time: Fri Oct 24 20:50:43 GMT 2014

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

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