I am new to Selenium
.
My issue is that I'm trying to click an element but Selenium
is throwing a timeout exception
, even if I increase the timeout value.
Do I need to use xpath
instead of id
?
The HTML Code is:
void searchquotation() throws TimeoutException {
try {
WebDriverWait wait = new WebDriverWait(driver, 15);
WebElement element = wait.until(ExpectedConditions.presenceOfElementLocated(By.name("SearchButton")));
element.click();
}
catch(TimeoutException e) {
System.out.println("Timeout occured");
}
Am I doing anything wrong?