testng-team / testng-eclipse

Eclipse plug-in for TestNG
https://testng.org
194 stars 164 forks source link

Could not find or load main class org.testng.remote.RemoteTestNG #491

Closed GoldSpeci closed 4 years ago

GoldSpeci commented 4 years ago

Having problems running TestNG from Eclipse.

What I tried.

1. Add the testng folder with the content from offline updatesite into the eclipse/dropins.

The result is that I am able to run TestNG from the context menu runAs TestNG test. But getting: Could not find or load main class org.testng.remote.RemoteTestNG

2. Installed the TestNG from Eclipse / Help / Install new Software from here:https://dl.bintray.com/testng-team/testng-eclipse-release/

It doesn't install completely. Just have the entries in the features folder. Taking the content from the testng (plugins) folder and copy to the plugins folder.

Result: TestNG is not showing in the Windows / Preferences and not able to run a test from context menu in Eclipse.

Doing the Install new Software from Eclipse / Help (the second time) is bringing up the TestNG in Windows / Preferences but running the test as TestNG brings up the above Exception again. Could not find or load main class org.testng.remote.RemoteTestNG

The tests run in the console just fine.

Any idea what I am missing? General question, is Eclipse able to run with the newest TestNG release? org.testng.eclipse.maven_7.1.1.202003100345

Eclipse Version: 2019-12 (4.14.0) Build id: 20191212-1212

In the Eclipse Error log I see this.

Stop the socket server as it's still pending on accepting the client

java.version=1.8.0_221 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE Framework arguments: -product org.eclipse.epp.package.jee.product Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product

Any relate message in "Error Log" view

The Dependency Management tool for your project

Operating System

missedone commented 4 years ago

sounds like installation issue, pls follow the steps here in a clean eclipse instance: https://github.com/cbeust/testng-eclipse#install-release

GoldSpeci commented 4 years ago

Thanks a lot for the answer. Did follow the steps above various times (I tried now with a fresh Eclipse install). What I have working is Eclipse 2018-09 with Testng 7.1 and the plugin version 6.9.13

This is what I tried so far and didn't work. Eclipse 2019-12 with Testng 7.1 plugin 7.1 Eclipse 2019-12 with Testng 7.1 plugin 7.2 Eclipse 2019-12 with Testng 7.1 plugin 6.9.13 Like I stated above I have already problems installing the plugin completely from the url. The only way I found out installing the plugin completely, is as archive from a zip. But than I get the error. Any other idea what I could try? Thanks a lot.

jacquelinesanders commented 4 years ago

To fix this issue:

Right-click on the project that you are trying to run tests for Select Properties In the left-hand menu, select TestNG Uncheck Use project TestNG jar Click Apply and Close

GoldSpeci commented 4 years ago

Thanks Jacqueline for your answer. Unfortunately there is no Use project TestNG jar (a guess it should be a checkbox) on my Eclipse with the path you mentioned. Just tried out, no error with Eclipse 2019-06 Build id: 20190614-1200

Scarter04 commented 4 years ago

Are you testing on a corporate network? If so, this may be the problem. You will have to get someone at your job to unblock TestNG and allow it to run on the network. Hope this helps.

GoldSpeci commented 4 years ago

Thanks for the reply. Yes it is on a network. I try your suggestion. Have a great day.

GoldSpeci commented 4 years ago

I try to make it work with Eclipse 2020-03. This error is not showing up with that version and Issue 490 was solved. So far so good. Thanks.

missedone commented 4 years ago

so sounds like not an issue, closing this, feel free create a new one.