Skip to content

Commit

Permalink
Better formatting, link example in Ruby with Watir
Browse files Browse the repository at this point in the history
  • Loading branch information
mguillem committed Mar 20, 2014
1 parent 825d844 commit 6fe6744
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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<JavaScriptError> jsErrors = JavaScriptError.readErrors(driver);
assertTrue(jsErrors.toString(), jsErrors.isEmpty());

Download:
final List<JavaScriptError> 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].

Expand All @@ -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

0 comments on commit 6fe6744

Please sign in to comment.