Я узнаю о тесте Selenium Webdriver с использованием Java для тестирования моего приложения.
Я уже внедрил свои тесты в Google Chrome и Firefox, но msedgedriver.exe не открывает браузер Edge.
Мне нужна помощь!
public WebDriver getDriver() {
return driver;
}
@BeforeAll
/*--- INICIALIZAÇÃO DO OGFIN*/
public void abrirOgfin() throws Exception {
String link;
int x=2;
switch(x) {
case 1:
System.setProperty("webdriver.gecko.driver", "C:\\workspace\\conf\\firefox\\geckodriver.exe");
driver = new FirefoxDriver();
//link = "http://sistema.ogfin.com.br/ogfin/Login"; //Servidor
link = "http://192.168.1.46:8888/ogfin/Login"; //Local
break;
case 2:
System.setProperty("webdriver.edge.driver", "C:\\workspace\\conf\\edge\\msedgedriver.exe");
driver = new EdgeDriver();
//link = "http://sistema.ogfin.com.br/ogfin/Login"; //Servidor
link = "http://192.168.1.46:8888/ogfin/Login"; //Local
break;
default:
System.setProperty("webdriver.chrome.driver", "C:\\workspace\\conf\\chromedriver.exe");
driver = new ChromeDriver();
link = "http://sistema.ogfin.com.br/ogfin/Login"; //Servidor
//link = "http://192.168.1.46:8888/ogfin/Login"; //Local
}
driver.manage().window().maximize();
driver.get(link);
}
Когда я запускаю код, консоль показывает:
Starting MSEdgeDriver 75.0.139.20 (02d0ed4079b152f381df65e7da8a795530021fb1) on port 9579
Only local connections are allowed.
Please protect ports used by the WebDriver and related test frameworks to prevent access by malicious code.