testngtestng-eclipse

TestNG:Exception in thread "main" com.beust.jcommander.ParameterException: Unknown option: -protocol


On running the testng.xml, I am getting the following error:

Exception in thread "main" com.beust.jcommander.ParameterException: Unknown option: -protocol
    at com.beust.jcommander.JCommander.parseValues(JCommander.java:742)
    at com.beust.jcommander.JCommander.parse(JCommander.java:282)
    at com.beust.jcommander.JCommander.parse(JCommander.java:265)
    at com.beust.jcommander.JCommander.<init>(JCommander.java:210)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:161)

No errors are there in the actual selenium classes.


Solution

  • Issue is resolved now. The problem was occurred by the RemoteTestNG loading. So I just removed the C:/Program%20Files/Java/jdk1.8.0_40/jre/lib/ext/testng-6.9.6.jar. I am able to run the testng.xml without any error message. Thanks @XuQing Tan for your valuable comments.