Skip to content

Instantly share code, notes, and snippets.

@tarun3kumar
Created January 5, 2012 17:56
Show Gist options
  • Save tarun3kumar/1566370 to your computer and use it in GitHub Desktop.
Save tarun3kumar/1566370 to your computer and use it in GitHub Desktop.
Using selenium waitForCondition method
public class LoginTest {
@Test
public void testLogin() {
login(userName, userPassword);
waitForCondition("selenium.isElementPresent(\""+UserDashboard.getDashboardLocator()+"\")", "60000");
// Some assertion here
}
}
class UserDashboard {
public static String getDashboardLocator() {
return "//a[text()='Dashboard']";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment