Timeouts can be set in ChromeOptions, or set after the driver is created. The exact syntax depends on which language you are using.
Map<String, Object> timeouts = new HashMap<>();
timeouts.put("implicit", 10);
timeouts.put("pageLoad", 20);
timeouts.put("script", 15);
ChromeOptions options = new ChromeOptions();
options.setCapability("timeouts", timeouts);
In Java, setting with the driver:
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.manage().timeouts().pageLoadTimeout(20, TimeUnit.SECONDS);
driver.manage().timeouts().setScriptTimeout(4, TimeUnit.SECONDS);
You can also use WebDriverWait, which will retry a command until it is successful, or the specific timeout expires. It gives you more control over which commands use timeouts. See the documentation for more details.
- Tricia