Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » How to click a button until the condition is true.?
How to click a button until the condition is true.? [message #1077768] Fri, 02 August 2013 01:50 Go to next message
Pawan Relan is currently offline Pawan Relan
Messages: 3
Registered: July 2013
Junior Member
Hi,

I want button.click() to be executed until the conditon in while condition in loop is False.
Please refer the following code...
final SWTBotButton button = bot.button("Next");
do
{
button.click();
}
while(bot.label("LabelName").isVisible()==false);

My Program goes into time out after executing "button.click();" once or twice even though the value returned by while loop is false.

Regards,
Pawan Relan
Re: How to click a button until the condition is true.? [message #1090064 is a reply to message #1077768] Mon, 19 August 2013 13:02 Go to previous messageGo to next message
Mickael Istria is currently offline Mickael Istria
Messages: 676
Registered: July 2009
Location: Grenoble, France
Senior Member
The error you get seems to show that the button is hidden when you try
to click it for the 2nd or 3rd time, independently of the condition.

--
Mickael Istria
JBoss, by Red Hat
My blog: http://mickaelistria.wordpress.com
My Tweets: http://twitter.com/mickaelistria
Re: How to click a button until the condition is true.? [message #1091359 is a reply to message #1077768] Wed, 21 August 2013 07:55 Go to previous message
Pawan Relan is currently offline Pawan Relan
Messages: 3
Registered: July 2013
Junior Member
Thanks Mickael for your Reply
I have verified but the button is visible and also enabled.
However sometimes "button.click()" is working for more than 4 or 5 iterations but it not able to complete all the iterations.

Regards,
Pawan Relan

[Updated on: Wed, 21 August 2013 07:56]

Report message to a moderator

Previous Topic:How to click on different Editor parts in Editor.
Next Topic:SWTWorkbenchBot equivalent for E4
Goto Forum:
  


Current Time: Tue Oct 08 01:18:20 EDT 2013

Powered by FUDForum. Page generated in 0.04753 seconds