Skip to content

Instantly share code, notes, and snippets.

@nestoralonso
Created May 23, 2017 04:54
Show Gist options
  • Save nestoralonso/8dc4f9291c9e8de4831c1ded8a52c4e5 to your computer and use it in GitHub Desktop.
Save nestoralonso/8dc4f9291c9e8de4831c1ded8a52c4e5 to your computer and use it in GitHub Desktop.
var webdriverio = require("webdriverio");
var options = {
desiredCapabilities: {
browserName: "chrome"
}
};
var client = webdriverio.remote(options);
function init() {
return client.init().url("https://news.ycombinator.com/");
}
async function doStuff() {
console.log('doStuff');
const selectorEx = client.selectorExecute("//div", function(inputs) {
return "divs on page " + inputs.length;
});
const res = await selectorEx;
console.log(">>", res);
}
client = init();
doStuff();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment