Pregunta

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.

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top