Last active
August 29, 2015 13:59
-
-
Save ragulka/10458018 to your computer and use it in GitHub Desktop.
Injecting and executing Javascript in Selenium tests using camme/webdriverjs
This file contains 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
// This snippets shows how you can inject and execute Javascript in your Selenium tests using camme/debriverjs. | |
// This particular example uses jQuery to get the count of list-item elements on the page and returns it. | |
// In the callback you can then access the returned value as `result.value` | |
it('must have 4 list-item elements', function (done) { | |
client | |
.execute(function() { | |
return $('ul li').length; | |
}, [], function (err, result) { | |
result.value.must.eql(4); | |
}) | |
.call(done); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment