Hi Guys , 

Is there a way on how to retrieve running results on Selenium ? Ever time I run a test scripts/ suite I wanted to retrieve it automatically. Can you please help me or do you know how to ? :)

Thanks in Advance 

Views: 261

Reply to This

Replies to This Discussion

Hi,

Selenium ifself will not generate any HTML reports after its execution. If you need HTML reports you can use TestNG framework, which will generate nice HTML reports with all the data like "No. Of Executed Test Cases", "Passed", "Failed" and "Skipped".

There are two ways to configure TestNG. They are:

1. We need to download the testng jar file and place it in your classpath. Then try to import it in your code

2. If you are using Eclipse as your IDE, you can download the eclipse plugin for TestNG and write the test cases directly using TestNG.

To know more about TestNG, please refer to the below link "http://toolsqa.com". Please let us know if you need any more information.

Thanks and Regards,

Karthik

Hi,

If the question is how to get the results of the tests, there are a number of ways that this can be accomplished. The main question though is what type of implementation is going to be used? Java or other dev. language?

If you choose the following: Java + Selenium + Maven + Junit it will allow you to take advantage of the Surefire Report plugin. What this plug allows you to do is to create nicely formatted reports that will show pass, fail and run times for each of the tests.

Again the choice of framework language will certainly influence the reporting methodology used.

The TestListenerAdapter has methods for each of those situations (success, skipped, failure). My suggestions is to make your own listener like this.

public class MyTestResultListener extends TestListenerAdapter {      @Override     public void onTestFailure(ITestResult result) {         // do what you want to do     }      @Override     public void onTestSuccess(ITestResult result) {         // do what you want to do     }     @Override     public void onTestSkipped(ITestResult result) {         // do what you want to do     } }

Then add your listener to the test class.

@Listeners(MyTestResultListener.class) public class MyTest {  // your tests  }

Thanks.

RSS

Adverts

© 2017   Created by Rosie Sherry.   Powered by

Badges  |  Report an Issue  |  Terms of Service