Skip to content

Instantly share code, notes, and snippets.

@freynaud
Created September 1, 2011 17:01
By loginError = By.id("topErrorMessages");
boolean loginHasChanged = false;
try {
driver.findElement(loginError);
} catch (NoSuchElementException e){
loginHasChanged = true;
}
if (loginHasChanged) {
// someone has changed the login
// check the info message about login change is there
assert.assertEquals(driver.findElement(By.id("login_change_msg").getText()),"The login details have change, use the new one");
}else {
// normal case
// do something else
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment