Не удалось изменить порт по умолчанию в Winium Driver - PullRequest
0 голосов
/ 16 октября 2018

** Даже после указания порта, отличного от 9999, драйвер winium запускается на 9999. Как изменить этот порт по умолчанию?Я использую приведенный ниже код для запуска драйвера Winium в Windows 10:

Code:**

public class outlook_poc {

    public static void main(String[] args) throws IOException {
    DesktopOptions option = new DesktopOptions();
    option.setApplicationPath("C:/Program Files/Microsoft Office/Office15/outlook.exe");
    System.setProperty("webdriver.winium.desktop.driver","C:\\Winium\\Winium.Desktop.Driver.exe");
    File driverpath = new File("C:/Downloads for Selenium/Winium.Desktop.Driver/Winium.Desktop.Driver.exe");    
    WiniumDriverService service = new WiniumDriverService.Builder().usingDriverExecutable(driverpath).usingPort(18434).withVerbose(true).withSilent(false).buildDesktopService();

    service.start();    
    System.out.println("test");

    WiniumDriver winDriver = new WiniumDriver(service,option);
    winDriver.findElementByName("OK").click();
    service.stop();
    }

}

Output trace :

Starting Windows Desktop Driver on port 9999

04:32:43 [DEBUG] Waiting for a connection...
Exception in thread "main" org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:05:20.749Z'
System info: host: 'DALQEWIN1101', ip: '10.9.109.56', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_181'
Driver info: driver.version: unknown
    at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:193)
    at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:179)
    at test.outlook_poc.main(outlook_poc.java:25)
Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:18434/status] to be available after 20015 ms
    at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:100)
    at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:188)
    ... 2 more
Caused by: java.util.concurrent.TimeoutException
    at java.util.concurrent.FutureTask.get(FutureTask.java:205)
    at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:156)
    at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:75)
    ... 3 more
--------------
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...