Processing runtime parameters

Finally, when the test suite is run, there needs to be a place to process the system properties, suite parameters, or default variables and pass them to the setDriver method. This can be done in the CommonSetup.java class.

In this case, we are switching from a local run to a remote run on the Selenium Grid, so we need to set the Global_VARS.DEF_ENVIRONMENT variable:

@Parameters({"browser","platform","environment"})
@BeforeSuite(alwaysRun=true, enabled=true)
protected void suiteSetup(@Optional(Global_VARS.BROWSER) String browser,
@Optional(Global_VARS.PLATFORM) String platform,
@Optional(Global_VARS.ENVIRONMENT) String
environment)
throws Exception {

Global_VARS.DEF_BROWSER = System.getProperty("browser", browser);
Global_VARS.DEF_PLATFORM = System.getProperty("platform",
platform
);
Global_VARS.DEF_ENVIRONMENT = System.getProperty("environment",
environment
);

CreateDriver.getInstance().setDriver(Global_VARS.DEF_BROWSER,
Global_VARS.DEF_PLATFORM,
Global_VARS.DEF_ENVIRONMENT);
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.168.28