How can I replace this implicit wait with an explicit one?
driver = new ChromeDriver(capabilities);
driver.manage().deleteAllCookies();>
once you declare implicitlyWait
it will apply to your all element through out the script run. So declare it initially to prevent from script getting fail.
Now if there is element which requires explicit wait then just declare it just before to do some action or use refernce of same. explicit wait is not applied through out like implicitlyWait
.
Example :-
WebElement seleniumlink;
seleniumlink= wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//input[@id='add_files_btn']")));
seleniumlink.click();
Refer below link for more details :-
https://www.guru99.com/implicit-explicit-waits-selenium.html