New Cucumber Project - Run as TestNG Test option not available on right click the MyRunner class. | Selenium Forum
P
Pravin V. Kumbhare Posted on 18/02/2022

Hello,

I created a Maven project, with Cucumber depepndencies and a Feature file. But on right clicking the Runner class, the "TestNG Test" option is not shown.

When I right click the package name instead, the said option is there.


E
ermohit.chawla Replied on 27/02/2022

You have to install the TestNG package from the eclipse marketplace to see the option. ( Only adding dependency in pom.xml does not show the run as "TestNG suite" option.


P
Pravin V. Kumbhare Replied on 15/03/2022

I've already done this, but still no luck.

I'm trying to remove the existing TestNG installation from Installed Softwares, but the uninstall button itself is disabled. I also tried running Eclipse as Admin, but the same issue is there.

Now I've created testng.xml file, and running this file instead of the runner class directly.


A
Ashish Thakur Replied on 15/03/2022

Have you installed the cucumber eclipse plugin?


P
Pravin V. Kumbhare Replied on 15/03/2022

Hello sir,

Thank you for your reply.

I haven't added the cucumber eclipse in the PLUGINS tag, but have added the DEPENDENCY for cucumber-java, cucumber-testng, and testng:

<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>${cucumber.version}</version>
</dependency>

<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-testng</artifactId>
<version>${cucumber.version}</version>
</dependency>

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>${testng.version}</version>
</dependency>

The cucumber.version in properties tag is - 6.8.2.

In plugins, I've added only two plugins - maven-compiler-plugin (no version specified), and maven-surefire-plugin - 3.0.0-M5


Related Posts