webdriverIOでWebページのリンクをクリックしようとしています。 google.comページに移動して検索語を入力できます。webdriverIOのリンクをクリックする方法
しかし、私が望むテキストを含むリンクをクリックしようとすると、リンクをクリックしません。私が間違っているのは何
:
ここに私のコードです:私はNode.jsののv6.9.2とセレンとのwebdriverIOだけでは、サーバー3.0.1を立て実行しています
var webdriverio = require('webdriverio');
var options = {
desiredCapabilities: {
//browserName: 'phantomjs'
browserName: 'chrome'
}
};
webdriverio
.remote(options)
.init()
.url('http://www.google.com')
.setValue('*[name="q"]','webdriverio')
.click('*[name="btnG"]')
.pause(1000)
.getTitle().then(function(title) {
console.log('Title was: ' + title)
})
.getText('=webdriver.io').then(function(text) {
console.log('Title was: ' + text); // outputs: "WebdriverIO"
})
.end();
が。
ありがとうございました。
これは問題ではありません。 google.comにアクセスしてwebdriverioを検索しても問題ありません。それは私の問題であるページ自体のリンクを盗んでいる。 – ironmantis7x