Join 500+ Software Testing professionals. Solve problem and get your problem solved. Register Now!

0
got error for the grid test

Duplicate 1 Answers 64 Views Selenium
0 1
@Parameters({"browserName","version","platform"})
@BeforeMethod
public void PreCondition(String browserName, String version, String platform) throws MalformedURLException 
{
 
if(browserName.equals("firefox")) 
// new DesiredCapabilities();
cap =DesiredCapabilities.firefox();
else if(browserName.equals("chrome")) 
// new DesiredCapabilities();
cap= DesiredCapabilities.chrome();
else 
 
cap= DesiredCapabilities.internetExplorer();
 
 
cap.setCapability("platform", platform);
if(version!=null)
   if(!version.equals(""))
cap.setVersion(version);
   driver = new RemoteWebDriver(new URL("http://192.168.1.---:4444/wd/hub"),
                cap);
   driver.navigate().to("");
 
 
 
}
FAILED CONFIGURATION: @BeforeMethod PreCondition
org.testng.TestNGException: 
Parameter 'browserName' is required by @Configuration on method PreCondition but has not been marked @Optional or defined
in C:\Users\ajeetbsol\AppData\Local\Temp\testng-eclipse--1723549126\testng-customsuite.xml

 

closed as a duplicate of: Getting the error

1 Answer

0
0 answered by
edited by
...