title: org.testng.TestNGException: Cannot inject @Test annotated Method with [class java.lang.String]
body: <p>i am getting below error for TestNG. Not sure why</p>
  
  <p>below is complete error:
  FAILED: launchB
  org.testng.TestNGException:</p>
  
  <p>Cannot inject @Test annotated Method [launchB] with [class java.lang.String].</p>
  
  <pre><code>For more information on native dependency injection please refer to http://testng.org/doc/documentation-main.html#native-dependency-injection
  at org.testng.internal.Parameters.checkParameterTypes(Parameters.java:244)
  at org.testng.internal.Parameters.createParameters(Parameters.java:172)
  at org.testng.internal.Parameters.createParameters(Parameters.java:458)
  at org.testng.internal.Parameters.handleParameters(Parameters.java:569)
  at org.testng.internal.Invoker.handleParameters(Invoker.java:1308)
  at org.testng.internal.Invoker.createParameters(Invoker.java:1036)
  at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1126)
  at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
  at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
  at org.testng.TestRunner.privateRun(TestRunner.java:744)
  at org.testng.TestRunner.run(TestRunner.java:602)
  at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
  at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
  at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
  at org.testng.SuiteRunner.run(SuiteRunner.java:289)
  at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
  at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
  at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
  at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
  at org.testng.TestNG.runSuites(TestNG.java:1144)
  at org.testng.TestNG.run(TestNG.java:1115)
  at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
  at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:230)
  at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:76)
  </code></pre>
  
  <p>Below is the code:</p>
  
  <pre><code>    public class LaunchBrowser_2 {
  WebDriver driver;
  String browser = "IE";
  @Test
  public void launchB(String browser){
  
      System.setProperty("webdriver.gecko.driver", "D:\\geckodriver\\geckodriver.exe");
      System.setProperty("webdriver.chrome.driver", "D:\\Chromedriver\\chromedriver.exe");
      System.setProperty("webdriver.ie.driver", "D:\\IEDriver\\IEDriverServer.exe");
  
      if(browser.equals("Mozilla"))
          driver = new FirefoxDriver();
      else if (browser.equals("Chrome"))
          driver = new ChromeDriver();
      else if (browser.equals("IE")){
          DesiredCapabilities cap = DesiredCapabilities.internetExplorer();
          cap.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
          driver = new InternetExplorerDriver(cap);                               
      }
      driver.manage().window().maximize();
      //driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
      driver.get("http://www.rediff.com");        
  }
  </code></pre>