I have 6 selenium tests (TestNG) running on chrome and firefox (both up to date versions) which connect to Browser stack to run.
the problem is that 1 of the test fails intermittently on Chrome as the sendKeys method is entering the email twice after clearing the text field. (i have seen that field gets cleared successfully in the test run)
problem - value entered twice: [email protected]@test.com
.
the tests run on gocd (like Jenkins) every morning. it only fails when run on gocd but when testing on my intellij these tests are always passing.
this is my code to clear and send the text
private void editTextField(String textToInput, WebElement element) {
element.clear();
element.sendKeys(textToInput);
}
public void editPassengerDetails(String name, String lname, String email) {
waitForPageCheckOutPageToLoad();
openPassengerDetailsBox.click();
editTextField(name, emailFirstName);
editTextField(lname, emailLastName);
editTextField(email, emailAddress);
}
test
checkoutPage.editPassengerDetails("Testfnames", "Testlname", "[email protected]");
can someone see anything wrong with this?