import org.openqa.selenium.*;

import org.openqa.selenium.remote.DesiredCapabilities;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

public class Grid_2 
    WebDriver driver;
    String baseURL,nodeURL;

public void setup() throws MalformedURLException
    DesiredCapabilities capability=DesiredCapabilities.firefox();
    driver=new RemoteWebDriver(new URL(nodeURL),capability);


public void afterTest()

public void simpleTest()
    Assert.assertEquals("Qber Admin - A new way of Token System",driver.getTitle());

I am just running my project using selenium grid. i connected the hub and node. I wrote the test script. And click on run button it display the error message.Here is my error:

Exception in thread "main" java.lang.NoSuchMethodError: org.testng.internal.Utils.defaultIfStringEmpty(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; at org.testng.remote.AbstractRemoteTestNG.setHost(AbstractRemoteTestNG.java:59) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:137) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:57)

  • which version of TestNG (Plugin and the JAR) are you using? Sep 19 '16 at 7:44
  • @TESTasy. I am using latest version. selenium server standalone 3.0 beat3.jar. and how I check my testng plugin.
    – user21268
    Sep 19 '16 at 7:59
  • testng.org/doc/eclipse.html this might help with checking the version. OR This: tutorialspoint.com/testng/testng_plug_with_eclipse.htm Sep 19 '16 at 8:20
  • @TESTast testng plugin is 6.9.0 Why it is not working?
    – user21268
    Sep 19 '16 at 8:23
  • Could you confirm that the plugin you used is latest release, or even you can try with the latest beta testng.org/eclipse-beta. Also, make sure there is only one testing on your classpath, either the fat jar of selenium or the stock testing jar. Hope this helps. Nov 21 '16 at 10:45

Usually this issue come due to version of TestNG Plugin. So please upgrade your TestNG plugin

Change Log of TestNG

Issue Reported

  • Link only answers usually get removed. Want to write the solution here? Sep 24 '16 at 3:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy