To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/yMtcQMqfqXMJ.--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
// Some Java code
@Test
public void bla() throws InterruptedException{
String eval = "";
boolean hasEnteredText = false;
do{
askForEmail(selenium);
try{
while (!(eval = driver.switchTo().alert().getText()).equals("")) {
Thread.sleep(100L);
}
} catch (NoAlertPresentException e) {
}
if((eval = selenium.getEval("mememe")) != null && ( eval != "" ) && (!eval.equals("undefined")) ) {
hasEnteredText = true;
}
}while(!hasEnteredText);
System.out.println(eval);
}
public void askForPassword(final Selenium selenium){
askForText(selenium,"password");
}
public void askForEmail(final Selenium selenium){
askForText(selenium, "mememe");
}
public void askForText(final Selenium selenium, final String text){
selenium.runScript(text
+ " = prompt(\"please enter your " + text + "\", \""+text+"\");");
}