NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

/***************** Browser Controller ********************/

public void browserController (Map<String,String> testDataValues){

logger.debug("Executing browser controller");
//Fetching the value of journeyID alone
String browserToBeExecuted = testDataValues.get("journeyid");

logger.debug("Journey ID returned to browserController :" + browserToBeExecuted + "n");

String[] browser=browserToBeExecuted.split("_",0);

logger.debug("browser Considered : " + browser[1]);


switch(browser[1].toLowerCase())
{


case "gchrome":

if(constants.pathToChromeDriver!=null)
{
logger.info("browser executed: Chrome");

if(constants.driver==null || chromeSession.equals(""))
{


System.setProperty("webdriver.chrome.driver",constants.pathToChromeDriver);

/****
To remove message "You are using an unsupported command-line flag: --ignore-certificate-errors.
Stability and security will suffer."
Add an argument 'test-type'
******/

ChromeOptions options = new ChromeOptions();
Map<String, Object> prefs = new HashMap<String, Object>();
prefs.put("credentials_enable_service", false);
prefs.put("password_manager_enabled", false);
options.setExperimentalOption("prefs", prefs);

DesiredCapabilities cap=new DesiredCapabilities();
cap.setCapability(ChromeOptions.CAPABILITY, options);


constants.driver = new ChromeDriver(cap);

chromeSession = ((ChromeDriver)constants.driver).getSessionId();


}

logger.info("Chrome Session in " +chromeSession);

constants.driver.get(constants.environment);
constants.driver.manage().window().maximize();

//Assigning category. Each platform is marked as one category.
constants.extentTest.assignCategory("Chrome");

}else{

logger.error("Chrome driver : Missing");
reusuableFunctions.dispayAlert("ChromeDriver Missing in Mentioned Path");
}

break;

case "firefox":


logger.info("Browser executed: firefox");

if(constants.driver==null || ffSession.equals(""))
{

System.setProperty("webdriver.gecko.driver", constants.pathToFFDriver);
constants.driver = new FirefoxDriver();

ffSession = ((FirefoxDriver)constants.driver).getSessionId();

}

constants.driver.get(constants.environment);
constants.driver.manage().window().maximize();
logger.info("FireFox Session in " + ffSession);
constants.extentTest.assignCategory("FireFox");
break;

case "ie":

System.setProperty("webdriver.ie.driver", constants.pathToIEDriver);
if(constants.driver==null || ieSession.equals("") )
{
System.out.println("ie test");
constants.driver = new InternetExplorerDriver();

ffSession = ((InternetExplorerDriver)constants.driver).getSessionId();

}
constants.driver.get(constants.environment);

constants.driver.manage().window().maximize();
logger.info("IE Session in " + ieSession);
constants.extentTest.assignCategory("IE");


break;



default :
logger.error("Provided browser cannot be recognized " +browserToBeExecuted);

}


}


public void platformController (Map<String,String> testDataValues){

logger.debug("Executing platform controller");
//Fetching the value of journeyID alone
String platformToBeExecuted = testDataValues.get("journeyid");

logger.debug("Journey ID returned to platformController :" + platformToBeExecuted + "n");

String[] platform=platformToBeExecuted.split("_",0);
// System.out.println("platform[0]"+platform[0]);
// System.out.println("platform[1]"+platform[1]);
System.out.println("platform[2]"+platform[2]);
// logger.debug("Platform Considered : " + platform[2]);


switch(platform[2].toLowerCase())
{

case "ios":

logger.info("Platform executed: iOS");
testng = new TestNG();
suites = Lists.newArrayList();
suites.add(".//iostestng.xml");
testng.setTestSuites(suites);
testng.run();

constants.extentTest.assignCategory("iOS");

break;

case "android":

logger.info("Platform executed: Android");


testng = new TestNG();
suites = Lists.newArrayList();
suites.add(".//androidtestng.xml");
testng.setTestSuites(suites);
testng.run();

constants.extentTest.assignCategory("Android");

break;

case "dt":

logger.info("Platform executed: Desktop");

browserController(testDataValues);
break;

default :
logger.error("Provided platform cannot be recognized " +platformToBeExecuted);

}


}



     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.