I am working on selenium webdriverjs. Now I want to know about reporting tools, as up to now I am not using any reporting tools. Now I have decided to use a reporting tool. Please suggest me best reporting tool and why.
-
Did you read about TESTNG? that would help you to generate reports in html format..– Helping HandsMar 12, 2015 at 5:29
-
I heard about the TestNG, but I'm using javascript and mocha framework– QAMemberMar 13, 2015 at 5:37
-
Additionally to mocha take a look on kal tool– ProphetAug 11, 2015 at 12:03
3 Answers
WebDriverJs is just the driver to control the browser. For the tests itself I recommend a JavaScript based testing framework like QUnit or Mocha. The test framework take care of the test reports.
Mocha is also mentioned on the WebDriverJs wiki page. You can find more information about how the reporting works on the official websites.
- QUnit: Bottom left of the website
- Mocha: Chapter Report
Mocha provide different types of reports. Three of them generate HTML reports:
- HTMLCov: Shows the test coverage in a HTML page.
- Doc: Shows the tests in a HTML page. (Without results. Just documentation of present tests)
- HTML: Shows tests and results in a HTML page.
On stackoverflow someone descriped how to use the HTML reporter.
-
Thanks for your answer, already I am using the mocha framework but using mocha we are able generate only console based reports but I want to be generate a HTMl format. Is it possible to do with mocha ?– QAMemberMar 13, 2015 at 5:40
-
I am only using Selenium WebDriver with Java so I cannot answer your question about JS.
But with Java, you can generate your own HTML reports using one of the JUNIT classes, TestWatcher.
TestWatcher allows you to override the failed() and succeeded() JUNIT methods that are called automatically when a test passes or fails.
You can also override the starting() and finished() JUNIT methods that are called automatically when a test is about to start and when it finishes.
Since TestWatcher is a JUNIT class, I hope that you can use it from JavaScript as well.
If you are interested in some code examples, please see this article: How To Generate SELENIUM HTML reports
As Twaldigas says Selenium is just the driver of the browser. With respect to tests written in JavaScript take a look at Tesults especially if you have a large team and run automated tests using continuous integration. I have an interest in Tesults so be aware of this disclosure but it would do what you are looking for. You did not mention whether you are looking for an open source or on premises solution in which case you should consider other options listed in the other answers.