“Couldn't connect to the RemoteTestNG Client” at launch of TestNG on OSX-mountain-lion

孤街醉人 提交于 2021-02-10 09:22:09

问题


I am attempting to run the most basic example test using Eclipse, Selenium, Maven, and TestNG. I can run a test with Eclipse (or IntelliJ), Selenium, and Maven, (jUnit also works) but when I try to add in TestNG, I get the following:

"Couldn't connect to RemoteTestNG client. Make sure you don't have an older version of testng.jar on your class path. Reason: Timeout while trying to contact RemoteTestNG."

I have followed several tutorials and youtube walkthroughs. I performed the same steps on a Windows 7 VM and it worked the first time, so I think I am doing the configuration properly (i.e. classpaths).

I saw there were other similar topics:
Timeout while trying to contact RemoteTestNG in Selenium on Mac
"Couldn't contact the RemoteTestNG client" error when trying to run tests

but they were old and didn't seem to answer my question specifically.

I have never used these tools before, nor am I very familiar with Macs, so I have, as of yet, not been able to try running the same thing from the command line as I don't know exactly what command to use.

Is there a certain something I am missing or need to do for TestNG to work? Otherwise, I will have to always use the Windows VM which would be a pain.

Environment:
OS: OS X 10.8.5
TestNG: 6.8
Eclipse IDE for Java: Kepler SR1
Selenium: 2.38.0
Java: 1.7.0_45

Thanks for your time.


回答1:


I had the same error message.

OS: Linux Mint 15 Olivia
TestNG: 6.8.7
Eclipse IDE for Java: Kepler
Java: 1.6

I fixed the problem doing this :

Open the "Run configuration" (Run > Run Configuration) window of eclipse. Delete all the tests under "TestNG" (there were deleted tests).




回答2:


  1. Navigte to:

    Project -> properties ->TestNG
    
  2. Unselect the option:

    Use Project TestNg jar.
    

This solved my issue.




回答3:


Fixed it. The issue is that I had placed .jars in the Java/Extensions folder (including testng6.8.jar). Apparently this caused a conflict with maven. Cleaned it out and everything worked.



来源:https://stackoverflow.com/questions/20552090/couldnt-connect-to-the-remotetestng-client-at-launch-of-testng-on-osx-mountai

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!