I am using maven project in eclipse ide and added a testng dependency as:
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8.8</version>
<scope>test</scope>
</dependency>
but i am unable to see TestNg option when right click on any testclass
Step 1: Go to Eclipse help and click on the button to “Install New Software”. Step 2: Click the Add button and type “TestNG” as name and “http://dl.bintray.com/testng-team/testng-eclipse-release/” as a path. Step 3: Once you add the Path, you will notice a TestNG entry under the name.
Eclipse plug-in Java 1.7+ is required for running the TestNG for Eclipse plugin. Eclipse 4.2 and above is required.
Click on the “Eclipse Marketplace…” option listed under the help menu. In the “Find” input field, write “TestNG” and press enter to search.
After you have installed TestNG eclipse plugin, you need to create a TestNG run configuration. From the menu bar select: Run > Run Configurations. Select 'TestNG' from the list and select 'New Lanuch Configuration'. In there select class, method, whatever you want to run.
Step #1: Once Eclipse is launched, click on Help and then Eclipse Marketplace. Step #2: A new window would open up, wherein you need to type “TestNG” in the Find text box and click on the Go button.
We will be using Eclipse throughout the TestNG series, although it is completely up to you to run TestNG in Eclipse or any other IDE to write and run your test cases. Now you can run your first TestNG Selenium script. Happy testing!
See requirements section of testng documentation. If you have Java 1.6 or earlier, it won't load in Eclipse, you can figure this out by looking at the [workspace]/.metadata/.log file, you should see the error logged: Show activity on this post.
That dependency alone is hardly enough. You need to install TestNG Eclipse plugin to be able to use it as you describe.
Select Help / Install New Software... Enter the update site URL in "Work with:" field: Update site for release: https://dl.bintray.com/testng-team/testng-eclipse-release/. Make sure the check box next to URL is checked and click Next.
I am working on TestNG in Eclipse, I have added maven dependency using maven:
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.1.0</version>
</dependency>
When I tried to run my test file present in src/java/test folder, I can't see anything in RunAs, then I followed below steps:
Goto Help->Install new Software-> Click on Add button->
NOTE: 7.1.0 is my TestNG version, you can change this to your version.
It will show you TestNG -> Check it and install it -> Restart Eclipse. Now you can see TestNGTest option in your Run As option.
For more information, check README file in GitHub Repo: https://github.com/cbeust/testng-eclipse
Ensure you have at minimum Java JDK 7, which is required for TestNG. See requirements section of testng documentation.
If you have Java 1.6 or earlier, it won't load in Eclipse, you can figure this out by looking at the [workspace]/.metadata/.log file, you should see the error logged:
!ENTRY org.testng.eclipse 4 0 2015-08-16 06:36:21.383
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.testng.eclipse [432]
Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=1.7))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With