Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
213 views
in Selenium by Contributing Tester (32 points)
closed by
@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 like 0 dislike
by
edited by


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...