var webdriverio = require('webdriverio');
var options = {
desiredCapabilities: {
browserName: 'firefox'
}
};
webdriverio
.remote(options)
.init()
.url('http://google.com')
.setValue('.gsfi', 'webdriver')
//.pause(3000)
.keys('Enter')
// .click('#btnG')
.getTitle().then(function(title) {
console.log('Title was: ' + title);
})
.end();
The code opens google.com, enters webdriver, but .keys('Enter') does not send enter. Instead the webbrowser remains open and nothing happens. Another attempt was .click('#btnG'), but nothing happens.
.keysfunction in FF I think (now 2018). Butelement.setValue(\${value}\n`);` as suggested in another answer here works fine. – KajMagnus Apr 28 '18 at 16:16