This commit is contained in:
Guillem Hernandez Sola
2026-06-17 10:17:06 +02:00
parent 6d0e9cd3fa
commit 7aef031ff9
2 changed files with 9 additions and 16 deletions

View File

@@ -45,7 +45,7 @@ public class BaseTest {
else { else {
driver = new ChromeDriver(); driver = new ChromeDriver();
} }
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(30)); driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));
driver.manage().window().maximize(); driver.manage().window().maximize();
jse = (JavascriptExecutor) driver; jse = (JavascriptExecutor) driver;
} }

View File

@@ -1,10 +1,7 @@
package com.agile611.testng.webdriver; package com.agile611.testng.webdriver;
import net.lightbody.bmp.BrowserMobProxy; import java.util.List;
import net.lightbody.bmp.BrowserMobProxyServer;
import net.lightbody.bmp.client.ClientUtil;
import net.lightbody.bmp.core.har.Har;
import net.lightbody.bmp.core.har.HarEntry;
import org.openqa.selenium.Proxy; import org.openqa.selenium.Proxy;
import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.firefox.FirefoxDriver;
@@ -14,8 +11,11 @@ import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod; import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import java.io.File; import net.lightbody.bmp.BrowserMobProxy;
import java.util.List; import net.lightbody.bmp.BrowserMobProxyServer;
import net.lightbody.bmp.client.ClientUtil;
import net.lightbody.bmp.core.har.Har;
import net.lightbody.bmp.core.har.HarEntry;
public class BrokenImages { public class BrokenImages {
WebDriver driver; WebDriver driver;
@@ -32,14 +32,7 @@ public class BrokenImages {
// 3. Inyectar el proxy en las opciones de Firefox // 3. Inyectar el proxy en las opciones de Firefox
FirefoxOptions options = new FirefoxOptions(); FirefoxOptions options = new FirefoxOptions();
options.setProxy(seleniumProxy); options.setProxy(seleniumProxy);
// Nota: Si usas Selenium 4.6+, esta línea ya no es necesaria gracias a Selenium Manager
System.setProperty("webdriver.gecko.driver",
"src" + File.separator + "test"
+ File.separator + "resources"
+ File.separator + "geckodriver-macos");
driver = new FirefoxDriver(options); driver = new FirefoxDriver(options);
} }