0
votes

HTML :

<input class="button" type="submit" value="Log In">

Code :

WebDriverWait wait = new WebDriverWait(driver, 10);
WebElement element = wait.until(ExpectedConditions.elementToBeClickable(By.xpath("input[@value='Log In']")));
driver.findElement(By.xpath("input[@value='Log In']")).click();
1
What's the context around "tried for 10 seconds with 500 milliseconds interval"? I'd move this bit of the text from the title and clarify it with additional info in the question. - i336_

1 Answers

0
votes

Your xpath is wrong

this

input[@value='Log In']

should be

//input[@value='Log In']

Like this

WebElement element = wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//input[@value='Log In']")));
driver.findElement(By.xpath("//input[@value='Log In']")).click();

//input selects all input elements in a document. Please read about it here