What is the equivalent of Nunit in Java for Eclipse? - java

I used to test an application using VS & NUnit and NUnit provided this interface which had all my tests listed under each browser. I had a selenium grid setup to run different browsers.
Nunit allowed me to run single test in individual browser or all test in one browser. It was really very useful. Now I am testing an app using Java and Selenium. I am wondering if there is a plugin like Nunit for eclipse so I can run all my tests using specific browser one by one. Any advice is greatly appreciated :) . Thanks

I used to use JUnit and Selenium WebDriver to acceptance test websites
We scratched the idea though, because i (and my other co-workers) had a tendency to overcomplicate the 'point-and-click' automatic acceptance tests, to the point where they were not reliable anymore (we had some huge flow-tests that caused these issues). Now we currently only smoketest HTML pages now, using HtmlUnit (more or less)

The equivalent of NUnit is TestNG or JUnit in Java. You can install TestNG in Eclipse by following the URL:
How to install TestNG in eclipse Kepler

Related

How to generate reports in selenium webdriver (java)?

I have written my automation scripts for a registration scenario using selenium webdriver and java in Eclipse IDE creating maven project.
I have written my entire script (End to end application flow) under java main .Now business people are planning to integrate with Jenkins.Can you please help me how to generate reports to see my output results in eclipse and jenkins?
Note :I have not used any cucumber annotations,features files,step definitions,test runner classes.I right click my project in Eclipse IDE and run as java application and see the results in console.
There are several known and widely used tools for creating test reports.
I prefer using extent report report.
It can be easily integrated with major testing frameworks like JUnit, NUnit, TestNG, etc.
You can simply find a lot of perfect tutorials how to use it. Like this and many others.
Since Selenium does not have itself a reporting functionality we have to import Reporting libraries such as extent reports. It can be easily integrated with major testing frameworks like JUnit, NUnit, TestNG, have .html reports and the level of customisation it offers is commendable. You can read this article. here
Also you can use TestNG reports here
But its more advantageable if you use extent reports

Calculate the code coverage of Selenium tests in Java

In IntelliJ, I am coding a Java Spring project built with maven. For that project, I created some selenium tests to test my web application and they work as intended. Though due to problems with spring annotations I wasn't able to create JUnit tests for my controllers, so I wanted to test them together with selenium.
I can get the code coverage of my JUnit tests just fine, but I haven't achieved the same for the Selenium tests. I tried using the integrated code coverage plugin of IntelliJ, Emma, and JaCoCo, but none of them give me any results.
I have already searched on StackOverflow, but all results I get are either with third-party tools, changing some configuration with my tomcat server + maven (I don't know much about these topics) and again JaCoCo (which doesn't work for me). Isn't there any easy way to achieve this within IntelliJ? JUnit code coverage works too, so why not selenium? Any help would be highly appreciated.

Open source Web Application Test Automation tool

We are starting on a web application and thinking of TDD development. Can anyone please provide me a list of open source tools to automate our testing.
Thanks in advance
Kaushik
First and the most important: Jenkins Continuous Integration Server (or a CI server from some other vendor).
You can also take a look at a list of CI servers in comparison.
There are also many other tools that ease the process of development using TDD such as:
Obviously Unit test frameworks (JUnit, TestNG)
Mocking frameworks (EasyMock, Mockito, PowerMock)
Also, don't forget Maven for building, Selenium for automating web app testing and JMeter for load testing.
Cheers,
Take a look at cucumber for BDD, it integrates with Jenkins and might help you with your acceptance tests.

Logging selenium for webdriver

Does any one use loggingselenium for webdriber? I am trying to create a nice HTML formatted report which will includes stack trace of a failed tests including a screen shot. Loggingselenium is the best library for the porpose as i explained above. I am using maven and surefire for my project and I need to use logging selenium for my project which was done using webdriver. or find out other solution which will help me to do the same thing. As I am using junit for my tests, i want something like this.Any help will be appreciated.
You should try QAF formerly ISFW. It has great logging and reporting features as well as some design concepts especially for web functional test automation using selenium 1 or 2. you can read below useful blogs:
About ISFW
FAQ

Can JUnit be used as an alternative to browser testing in Spring?

I'm building a Spring web app and up until now all of my testing is using a browser.
This involves starting the server, opening a browser window and checking to see if accessing any of the pages causes an error.
This is starting to get repetitive and doesn't seem to be the most efficient way to do this.
Since the Junit jar file is already in my project, could it be used as an alternative to this browser testing and, if so, any tips on how to get started making JUnit simulate the act of opening a browser to access the web app?
Take a look at Selenium. It allows you to script functional tests using JUnit or TestNG and execute them in a browser, automatically.
You can use the HTMLUnit extension to script to drive the web site from JUnit.
I used a while back and worked fine for thi site I was doing then.
see http://htmlunit.sourceforge.net/
I suggest you to try the Robot Framework. This is an open source testing framework developed by engineers in Nokia Siemens Networks.
It is primarily built on python and the Selenium testing libraries. It also includes support for testing Java/J2EE server side code through Jython libraries. I personally use it in my work sometimes, and writing a test case is just as easy as describing an end-to-end flow through the use of Keywords (most of required ones are already inbuilt). You could go ahead and give this a shot if you find Selenium a li'l tough to work with. The Robot framework provides a fairly simple abstraction over raw selenium, coupled with the power to make Java/J2EE server-side calls too.
Regards,
Nagendra U M

Categories

Resources