How to generate Selenium HTML Report in Jenkins? - maven

I created selenium test cases using TestNG. After that I created testng.xml and ran all classes parallely. Now the problem is to generate Selenium HTML Report in Jenkins. I exactly have to do that is mentioned in this link.
For that how to generate Selenium Html Report. I used Maven as build tool.

Selenium (RC) by itself doesn't generate any reports (as far as I know). It relies on the testing framework that it gets coupled with. Since you are using TestNG as your testing framework, TestNG does generate the html reports. You can go to your test-output folder and check for index.html which would be a link to the results. In case you are invoking through maven, check the target\surefire-reports folder for reports.
For integration with Jenkins, you can use the testng plugin (https://wiki.jenkins-ci.org/display/JENKINS/testng-plugin) which would give you the testng results on your job page.
You can also try if the html report generated by TestNG can be parsed by the plugin you mentioned, in case you want to use that plugin only.
Hope it helps.

You can also use Allure Report with pretty view and easy-to-use with maven

Try this http://www.wakaleo.com/thucydides/
This library generates well reports, but needs some changes in code.

Related

Is it possible to create html Cucumber Report without Maven

I'm working on Cucumber automation using selenium webdriver. I'm fairly new and have not used Maven just yet. I have not been able to generate an html report. Currently, my target remains blank.
Is it because I'm not using Maven or is it possible to create/generate without it
If YES, then how?
If NO, then whats the reason?
You can use cucumber without maven, you just need to add cucumber .jar file manually. (here you have exemple)
However I recommend you to use maven or ant or gradle. It does the same thing but automatically.

Is it possible to customize gradle's test reports? (Integrate geb reports with gradle test reports)

I am using geb + spock + gradle for tests and I'd really like to integrate a link to geb's screenshots into the gradle report. For those not familiar with geb, essentially it organizes screenshots for each test into a folder structure that follows the project package structure, for example:
com
domain
tests
package
class1
screenshot-of-test-method1.jpg
screenshot-of-test-method2.jpg
class2
screenshot-of-test-method1.jpg
I realize I'd have to write some code to figure out what the path to the image should be, but does gradle provide a way to customize the test reports that would allow me to at least insert the link somehow into the appropriate class's test report?
If gradle does not offer direct customization what other options or general approaches would you recommend?
Gradle's HTML test reporting doesn't expose any customization hooks. You'd have to post-process the HTML on your own.
For Geb Spock html reports along with screenshots, you can refer below project from github. This example is very nice to get html reports for geb spock along with screenshots and detailed error log in case of failure.
https://github.com/AOEpeople/geb-spock-reports

Difference between Maven and ANT while Test report generation?

Which is the best and featured way to generate reports either by using Maven or ANT? What are the features and differences ? I am using selenium webDriver with TestNG. By using testNG should I prefer "build.xml" or "pom.xml" ?
Maven and ant are build tools. What generates the reports is Testng. So if you use ant or maven, the report generated will still be the same. You can probably do a comparison between maven and ant as build tools, not as a report generation framework, to pick up the one you find better. If you might find this any help.. A blog written long back to describe the ecosystem..http://niharikawhatsnext.wordpress.com/2012/02/15/test-automation-to-building-to-execution-to-scheduling-java/
You can use both maven and ANT to produce XSLT reports which uses TestNg generated output.html. Both are mainly used for build purpose not for report generation.
The XSLT reports generated from maven and ANT both looks same. But there are many advantages in Maven over ANT in testing frame works (I am assuming you know what are those). So I would personally prefer Maven. Please go through the below links which you might found helpful.
http://www.javatpoint.com/difference-between-ant-and-maven
http://blog.varunin.com/2012/05/generate-testng-xslt-report-using-maven.html

possible to parameterise junit tests and run with maven?

I have a bunch of selenium webdriver tests split in different classes. I run these tests across a number of sites but I don't want to run them all on every site.
In the past I used msBuild and c# and wrote testng tests for software automation and I could add something like #Version1.5 after #Test then when I run my tests if the version in my properties file wasn't 5.1 it would skip that test.
Is something like this possible using maven and junit in Java?
Would JUnit Categories to the trick? Maven Surefire supports them but I am not sure how you would dynamically turn them on or off. You could definitely set up maven profiles to turn them on or off and then pass the appropriate profile as part of the maven command.

Getting ReportNG to generate its output in Maven's "site"?

I'm trying to use ReportNG with Maven (and Maven Surefire) to generate reports for the results of TestNG tests, within Eclipse. I believe I have followed the instructions here:
http://solidsoft.wordpress.com/2011/01/23/better-looking-html-test-reports-for-testng-with-reportng-maven-guide/
When I run a Maven "site:site", and then look at the generated website, I see the normal TestNG report rather than the ReportNG report.
Poking around the file system, I see that ReportNG has actually created a report, in target/surefire-reports/html. But in target/site, there's a "surefire-report.html" which is the regular TestNG report.
I am guessing that to get the ReportNG report to show up on the generated site, it would have to put an HTML page in target/site, like the regular TestNG report is. How can I make it that happen?
Thanks in advance.

Resources