문제

I'm facing problems by testing the chrome webstore - using WebdriverJS and my own node.js script.

When trying to query the result using css selectors, I get allmost everytime "no such element" errors from the WebDriver Server.

var client = require('webdriverjs').remote();
client.init().url('https://chrome.google.com/webstore',function(result{console.log(result);})
      .setValue('#searchbox-input','sampleapp \n')
      .click('**?what should be here?**', function(result){console.log(result);}).end();

I'm struggling with the part - ?what should be here? so i can automate clicks on a displayed result.

CSS selectors have strange formats and can't be accessed.

도움이 되었습니까?

해결책

Since the chrome webstore doens't seem to have button to click and submit the search, you could, instead, send the carriage return character and get it to trigger the search result. Try something like this:

var client = require('webdriverjs').remote();
client.init()
    .url('https://chrome.google.com/webstore')
    .setValue('#searchbox-input','sampleapp \u000D')
    .end();

The "\u000D" is just a carriage return unicode code.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top