Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsHow to wait until next label is visible
https://www.eclipse.org/forums/index.php/mv/msg/805235/1415126/#msg_1415126
For wait i m using bot.sleep(); API but because of this my test cases are failing. In my application wait is unpredictable, some time wait is more to open any shell or widget to visible.
My requirement is i need to wait until label is visible on next page.
Can any one suggest me documents or link on matcher and wait.
Thank you in advance]]>Shwetali Dhumal2014-09-02T06:39:29-00:00Re: How to wait until next label is visible
https://www.eclipse.org/forums/index.php/mv/msg/805235/1416215/#msg_1416215
Instead use bot.waitWhile or bot.waitUntil with smart conditions, it
should really make your tests more stable.
--
Mickael Istria
My job: http://www.jboss.org/tools
My blog: http://mickaelistria.wordpress.com
My Tweets: http://twitter.com/mickaelistria]]>Mickael Istria2014-09-04T15:37:19-00:00Re: How to wait until next label is visible
https://www.eclipse.org/forums/index.php/mv/msg/805235/1419788/#msg_1419788
Thanks for the reply. But can you please give me code snippet so i can get idea. I am using following code to wait until label is visible but this code is also not working:
bot.waitUntil(new DefaultCondition() {
@Override
public boolean test() throws Exception {
return !bot.label("labelName").isVisible(); // waits here until TRUE is returned. But max 5 seconds.
}
@Override
public String getFailureMessage() {
return "Error waiting for condition to be true."; // error msg here
}
});
And to wait for shell to open i am using following snippet. But i m not getting it is working or not.
Can u please tell this way is correct way
]]>Shwetali Dhumal2014-09-09T04:55:06-00:00Re: How to wait until next label is visible
https://www.eclipse.org/forums/index.php/mv/msg/805235/1421408/#msg_1421408
Using this type you can write for the Labels or Shell.
public static void waitForConnection(final String connectionName, final SWTBotTree Currenttree) throws Exception {
sleep(6000);
bot.waitUntil(new DefaultCondition() {
public boolean test() throws Exception {
SWTBotTreeItem[] TreeItems = Currenttree.getAllItems();
for (SWTBotTreeItem item : TreeItems) {
String text = item.getText();
if (text.contains(connectionName)) {
return true;
}
}
return false;
}
return "Connection with" + connectionName + " not visible in view.";
});
}]]>pawan garia2014-09-11T10:20:48-00:00Re: How to wait until next label is visible
https://www.eclipse.org/forums/index.php/mv/msg/805235/1421409/#msg_1421409
//@SuppressWarnings("unused")