0

I want to generate automation test report in eclipse project. I didn't create a marven project and I used Eclipse, Cucumber and Selenium web driver for automation scripting. But I cannot find how to generate an automation report.

Please tell me if there is a way to generate an automation report for a Java eclipse project. I have created the main class. It is as belows.

package mCollector;

import org.junit.runner.RunWith;

import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
@CucumberOptions(
        format = {"pretty","html:target"},
        features = {"src"}
        )

public class mCollectorRunner {

}

But only from this, I could not generate automation script. What are the additional parts that I have been missed.

2 Answers2

0

If you are using junit, the class should have a Test annotation. And when you are running it, choose run as junit instead of run as java application. After that, use ant to generate report is a easy way.

0

Run your class as JUnit, then you should have report.html in target folder after test, you can change directory of report output by changing line

...
    format = {"pretty","html:target"},
...

to

...
    format = {"pretty","html:test-reports"},
...

It will create folder called 'test-reports' in your project directory.

Maciek
  • 121
  • 4