Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Collects JS errors and make them available from WebDriver

tree: 59d0cd1fd7

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 .settings initial import
Octocat-spinner-32 dist
Octocat-spinner-32 firefox
Octocat-spinner-32 src
Octocat-spinner-32 .classpath
Octocat-spinner-32 .gitignore initial import
Octocat-spinner-32 .project
Octocat-spinner-32 README.markdown
Octocat-spinner-32 pom.xml
README.markdown

JSErrorCollector

This project allows to capture JavaScript errors while running tests with WebDriver. Ideally this feature should be built-in WebDriver but it is not (yet?) the case (see WebDriver issue API for checking for JavaScript errors on the page for details). Other information concerning JavaScript error capturing with WebDriver is available in this blog post.

Features:

  • provide access to JavaScript errors while running tests with a FirefoxDriver (in Java)

Usage:

    FirefoxProfile ffProfile = new FirefoxProfile();
    JavaScriptError.addExtension(ffProfile);
    final WebDriver driver = new FirefoxDriver(ffProfile);

    driver.get("http://somesite");

    final List<JavaScriptError> jsErrors = JavaScriptError.readErrors(driver);
    assertTrue(jsErrors.toString(), jsErrors.isEmpty());

Download:

Pre-built jar file is available in dist folder.

For non Java users:

The Firefox extension (the .xpi file) can be used from any language having a WebDriver binding. Here is an example about how it can be used in Ruby from Cucumber + Capybara.

Something went wrong with that request. Please try again.