diff --git a/README.markdown b/README.markdown index f011e8d..e2bd83b 100644 --- a/README.markdown +++ b/README.markdown @@ -6,33 +6,36 @@ Ideally this feature should be built-in [WebDriver] but it is not (yet?) the cas Other information concerning JavaScript error capturing with WebDriver is available in this [blog post] [3]. -Features: +## Features ## - provide access to JavaScript errors while running tests with a FirefoxDriver (in Java) -Usage in Java: +## Usage in Java ## +```java +FirefoxProfile ffProfile = new FirefoxProfile(); +JavaScriptError.addExtension(ffProfile); +final WebDriver driver = new FirefoxDriver(ffProfile); - FirefoxProfile ffProfile = new FirefoxProfile(); - JavaScriptError.addExtension(ffProfile); - final WebDriver driver = new FirefoxDriver(ffProfile); - - driver.get("http://somesite"); +driver.get("http://somesite"); - final List jsErrors = JavaScriptError.readErrors(driver); - assertTrue(jsErrors.toString(), jsErrors.isEmpty()); - -Download: +final List jsErrors = JavaScriptError.readErrors(driver); +assertTrue("JS errors occured: " + jsErrors, jsErrors.isEmpty()); +``` +## Download ## Pre-built jar file is available in [dist folder] [2]. -For non Java users: +## For non Java users ## The Firefox extension (the [.xpi file] [5]) 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] [4]. +Here are a few examples: +- [in Ruby from Cucumber + Capybara] [4]. +- [in Ruby with Watir] [8]. -A .NET port is available: [JSErrorCollector.NET by protectedtrust] [7]. +A **.NET port is available**: [JSErrorCollector.NET by protectedtrust] [7]. +## License ## JSErrorCollector is licensed under the terms of the [Apache License 2] [6]. @@ -44,3 +47,4 @@ JSErrorCollector is licensed under the terms of the [Apache License 2] [6]. [5]: https://github.com/mguillem/JSErrorCollector/raw/master/dist/JSErrorCollector.xpi [6]: http://www.apache.org/licenses/LICENSE-2.0.txt [7]: https://github.com/protectedtrust/JSErrorCollector.NET + [8]: https://gist.github.com/tkensiski/9656035