I'm using Node.js selenium-webdriver and I have this annoying issue. The issue is that the wait function throws an exception in console.
var webdriver = require('selenium-webdriver'),
By = webdriver.By,
until=webdriver.until;
var driver = new webdriver.Builder().forBrowser('chrome').build();
driver.get('https://****');
driver.manage().timeouts().implicitlyWait(5000);
driver.findElement(By.xpath("//div[@class='email-wrapper']/input")).sendKeys("[email protected]").then(function(element){
console.log("success "+ element);
});
driver.findElement(By.xpath("//div[@class='password-wrapper']/input")).sendKeys("123456").then(function(element){
console.log("success "+ element);
});
driver.findElement(By.xpath("//div[@class='button']/button")).getText().then(function(text){
console.log("Button text "+ text);
});
driver.findElement(By.xpath("//div[@class='button']/button")).click().then(function(element){
console.log("Button found "+ element);
});
driver.sleep(10000);
driver.quit();
Exception:
C:\\webdrivertut\library.js:13
driver.manage().timeouts().implicitWait(5000);
^
TypeError: driver.manage(...).timeouts is not a function
at Object.<anonymous> (C:\\webdrivertut\library.js:13:18)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3