Created
May 23, 2017 04:54
-
-
Save nestoralonso/8dc4f9291c9e8de4831c1ded8a52c4e5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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