forked from Zakaria/ZenProject
fix: 12 - testing firefox
This commit is contained in:
@@ -11,6 +11,7 @@ import org.openqa.selenium.WebDriver;
|
||||
import org.openqa.selenium.chrome.ChromeDriver;
|
||||
import org.openqa.selenium.chrome.ChromeOptions;
|
||||
import org.openqa.selenium.firefox.FirefoxDriver;
|
||||
import org.openqa.selenium.firefox.FirefoxOptions;
|
||||
|
||||
public class Initialization {
|
||||
// let's set up our variables
|
||||
@@ -48,13 +49,16 @@ public class Initialization {
|
||||
extent.setSystemInfo("Tester ID: ", "Sami");
|
||||
|
||||
// conditioning our WebDriver with an if statement
|
||||
String browsername = prop.getProperty("browserC");
|
||||
String browsername = prop.getProperty("browserF");
|
||||
|
||||
// launching FireFox
|
||||
if (browsername.equalsIgnoreCase("firefox")) {
|
||||
// System.setProperty("web-driver.gecko.driver","user.dir" +
|
||||
// "/drivers/geckodriver");
|
||||
// driver = new FirefoxDriver();
|
||||
FirefoxOptions options = new FirefoxOptions();
|
||||
options.addArguments("--headless");
|
||||
driver = new FirefoxDriver(options);
|
||||
driver.get(prop.getProperty("url"));
|
||||
}
|
||||
|
||||
@@ -63,9 +67,9 @@ public class Initialization {
|
||||
// System.setProperty("web-driver.gecko.driver", "user.dir" +
|
||||
// "/drivers/chromedriver");
|
||||
// driver = new ChromeDriver();
|
||||
ChromeOptions options = new ChromeOptions();
|
||||
options.addArguments("--headless");
|
||||
driver = new ChromeDriver(options);
|
||||
// ChromeOptions options = new ChromeOptions();
|
||||
// options.addArguments("--headless");
|
||||
// driver = new ChromeDriver(options);
|
||||
driver.get(prop.getProperty("url"));
|
||||
}
|
||||
driver.manage().window().maximize();
|
||||
|
||||
Reference in New Issue
Block a user