I've got a question:
Below there is my java code for selenium to load a url in chrome browser: chromedriver is 84.0.4147.30 Chrome version is also 84
public static int navigate(String data) {
driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
WebDriverWait wait = new WebDriverWait(driver, 30);
try {
driver.navigate().to(data);
wait.until(ExpectedConditions.invisibilityOfElementLocated(By.xpath("XPATH"));
....
}
What makes the automation: when chrome is running the url is typed in the adreesbar and it loads the page.
But when the page is not loaded after 30 seconds, the function does not stop and aborts the test. It waits endless. I think it is the load sign in the page title tab that is the problem.
What can I do to abort the waiting when page is not loaded after 30 seconds?
Thanks in advance.