Skip to content

Instantly share code, notes, and snippets.

@metafeather
Last active December 20, 2015 14:19
Show Gist options
  • Save metafeather/6145895 to your computer and use it in GitHub Desktop.
Save metafeather/6145895 to your computer and use it in GitHub Desktop.
Selenium direct calls to page JS
Examples:
JSCover report, ref: http://tntim96.github.io/JSCover/manual/manual.xml
String json = selenium.getEval("selenium.browserbot.getUserWindow().jscoverage_serializeCoverageToJSON();");
Via SeleniumJQuery, ref: https://github.com/Nthalk/SeleniumJQuery/blob/master/example/com/anteambulo/SeleniumJQuery/example/Example.java
jq.query("[name=q]").val("SeleniumJQuery").parents("form:first").submit();
String results = jq.queryUntil("#resultStats:contains(results)").text();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment