Edge Driver

This commit is contained in:
Guillem Hernandez Sola
2026-06-10 11:00:32 +02:00
parent c136d44437
commit baabaf7da1
4 changed files with 19 additions and 1 deletions

View File

@@ -7,8 +7,11 @@ import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions; import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.edge.EdgeOptions;
import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions; import org.openqa.selenium.firefox.FirefoxOptions;
import org.openqa.selenium.safari.SafariDriver;
import org.testng.annotations.AfterClass; import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeClass;
@@ -26,7 +29,22 @@ public class BaseTest {
+ File.separator + "resources" + File.separator + "resources"
+ File.separator + "geckodriver-macos"); + File.separator + "geckodriver-macos");
driver = new FirefoxDriver(options); driver = new FirefoxDriver(options);
} else { } else if (browser != null && browser.equalsIgnoreCase("edge")) {
EdgeOptions options = new EdgeOptions();
System.setProperty("webdriver.edge.driver",
"src" + File.separator + "test"
+ File.separator + "resources"
+ File.separator + "msedgedriver-macos");
driver = new EdgeDriver(options);
}
else if(browser != null && browser.equalsIgnoreCase("safari")){
System.setProperty("webdriver.safari.driver",
"src" + File.separator + "test"
+ File.separator + "resources"
+ File.separator + "safaridriver-macos");
driver = new SafariDriver();
}
else {
ChromeOptions options = new ChromeOptions(); ChromeOptions options = new ChromeOptions();
System.setProperty("webdriver.chrome.driver", "src" System.setProperty("webdriver.chrome.driver", "src"
+ File.separator + File.separator

Binary file not shown.

Binary file not shown.

Binary file not shown.