第一次尝试 nodejs 和 webdriverio。在 watir-webdriver 或 selenium-webdriver gems 中尝试时,这似乎很简单,但这让我在 webdriverio 中感到困惑。为什么当驱动程序已经找到元素并设置值时出现此错误
var webdriverio = require('webdriverio');
var options = {
desiredCapabilities: {
browserName: 'firefox'
}
};
var client=webdriverio.remote(options);
client
.init()
.url('http://www.twitter.com').title(function(err, res) {
console.log('Title was: ' + res.value);
})
.isExisting('#signin-password')
.then(function(isExisting){
console.log(isExisting);
})
.setValue('#signin-password','password')
.then(function(){
console.log("password set");
})
.isExisting('#signin-email')
.then(function(isExisting){
console.log("email"+isExisting);
})
.setValue('#signin-email','username')
.then(function(){
console.log("username set");
});
我得到的错误是
Title was: Welcome to Twitter - Login or Sign up
true
RuntimeError: Element is not currently visible and so may not be interacted with
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16'
System info: host: 'DTNBNAUD10806XS', ip: '10.36.179.144', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_05'
Driver info: driver.version: unknown
at elementIdValue("1", "password") - at C:\Development\node_modules\webdriverio\lib\commands\setValue.js:52:7