I've been running automation tests that execute relatively quickly in my local environment but are extremely slow in Sauce Labs.
The existing Java code appears to have two types of redundant page loading wait times
//1. set at the beginning of the test
driver.manage().timeouts().pageLoadTimeout(40, TimeUnit.SECONDS);
//2. called before every UI interaction/assertion
(new WebDriverWait(wDriver, waitTime)).until((wDriver) -> {
return javascriptExecutor.execute_script("return document.readyState").equals("complete")
});
Is the pageLoadTimeout a type of implicit wait that might be causing a conflict with the second "document.readyState" explicit wait?
Is this entirely redundant, or are there any edge cases where one of these checks might not work, and the secondary method acts as a backup?
Any help is appreciated AJ