This commit is contained in:
2024-10-02 11:22:57 -04:00
parent ed9847864a
commit 6add05fc69
4 changed files with 20 additions and 9 deletions
@@ -2,16 +2,21 @@ package zacksolutions.base;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.time.Duration;
import java.util.Properties;
import com.aventstack.extentreports.ExtentTest;
import com.aventstack.extentreports.reporter.ExtentSparkReporter;
import com.aventstack.extentreports.ExtentReports;
import io.github.bonigarcia.wdm.WebDriverManager;
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;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
public class Initialization {
// let's set up our variables
@@ -59,7 +64,6 @@ public class Initialization {
FirefoxOptions options = new FirefoxOptions();
options.addArguments("--headless");
driver = new FirefoxDriver(options);
driver.get(prop.getProperty("url"));
}
// launching Chrome
@@ -70,8 +74,8 @@ public class Initialization {
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
driver = new ChromeDriver(options);
driver.get(prop.getProperty("url"));
}
driver.get(prop.getProperty("url"));
driver.manage().window().maximize();
driver.manage().deleteAllCookies();
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(5));