When using @Parameters in my script, Iam getting errors. Need help on urgent basis. Kindly help

When trying to pass Parameters in my class.

 

Errors are:

Multiple markers at this line
– The attribute value is undefined for the annotation type
Parameters
– The annotation @Parameters is disallowed for this location

 

Pls find the code:

@Parameters(“browser”) // error comes here
@BeforeClass
public void setup(String br)
{

if(br.equals(“chrome”))
{
System.setProperty(“webdriver.chrome.driver”, readconfig.getChromePath());
driver = new ChromeDriver();

PropertyConfigurator.configure(“log4j.properties”);//This will work with 1.2 v or log 4j dependency, new version has diff type of code

}else if(br.equals(“firefox”))
{
System.setProperty(“webdriver.gecko.driver”, readconfig.getFirefoxPath());
driver = new FirefoxDriver();
}

driver.get(baseURL);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);

}

 

 

just wanted to confirm one thing are beforeclass and @test method are in same class??  

and can you please try passing parameters like this

@Parameters({“first-name”})

on July 18, 2018.
Add Comment
  • 0 Answer(s)
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.