Мне нужно попрактиковаться с TestNG, поэтому я следовал инструкциям по написанию аналогичного кода, чтобы открыть веб-сайт для практики:
Код: Выделить всё
package com.testautomationu.chp3annotations.Configuration;
//Class to exercise in testing using the BeforeMethod and AfterMethod notation
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.Test;
public class BM_AM_OrangeHRM {
WebDriver driver;
@BeforeMethod
public void setUp() {
System.setProperty("webdriver.chrome.whitelistedIps", "");
System.setProperty("webdriver.chrome.driver", "C:\\Users\\Carlo Cumino\\Downloads\\Drivers\\chromedriver-win64" +
"\\chromedriver.exe");
driver= new ChromeDriver();
driver.get("https://opensource-demo.orangehrmlive.com/");
}
@Test
public void signIn(){
WebElement textUser= driver.findElement(By.id("txtUsername"));
textUser.sendKeys("Admin");
WebElement textPassowrd= driver.findElement(By.id("txtPassword"));
textPassowrd.sendKeys("Admin123");
WebElement buttonLogin = driver.findElement(By.id("btnLogin"));
buttonLogin.click();
}
@AfterMethod
public void tearDown(){
driver.quit();
}
Код: Выделить всё
Starting ChromeDriver 131.0.6778.24 (970493e0d1f268b99c3e386d3bd2ee99719089d3-refs/branch-heads/6778@{#1222}) on port 19181
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully on port 19181.
nov 04, 2024 4:57:36 PM org.openqa.selenium.net.UrlChecker$1 call
INFO: Polling http://localhost:19181/healthz
nov 04, 2024 4:57:36 PM org.openqa.selenium.net.UrlChecker$1 call
INFO: Polling http://localhost:19181/healthz
nov 04, 2024 4:57:37 PM org.openqa.selenium.net.UrlChecker$1 call
INFO: Polling http://localhost:19181/healthz
Код: Выделить всё
INFO: Polling http://localhost:19181/healthz
java.lang.RuntimeException: Timed out waiting for http://localhost:19181/healthz to be available after 20058 ms
Как я могу решить эту проблему?
Подробнее здесь: https://stackoverflow.com/questions/791 ... ent-the-ip
Мобильная версия