power_settings_new

got error for the grid test [closed]

by (32 points)
asked
0 votes
80 views
@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

answered by
edited by
0 votes
add
...