У меня не получилось запустить
Код
BrowserMobProxyServer proxyServer = new BrowserMobProxyServer();
proxyServer.start();
System.out.println(proxyServer.isStarted());
Proxy seleniumProxy = ClientUtil.createSeleniumProxy(proxyServer);
WebDriverRunner.setProxy(seleniumProxy);
WebDriver driver;
Configuration.browser = "chrome";
Configuration.timeout = 20000;
Configuration.fileDownload = FileDownloadMode.PROXY;
Configuration.proxyEnabled=true;
Configuration.proxyPort=8889;
Configuration.pageLoadStrategy="normal";
System.setProperty("webdriver.chrome.driver", "C:\\Users\\chromedriver.exe");
ChromeOptions opts = new ChromeOptions();
opts.setBinary("C:\\Users\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe");
opts.addArguments("--window-size=1920,1080");
opts.addArguments("start-maximized");
Configuration.browser = "chrome";
driver = new ChromeDriver(opts);
WebDriverRunner.setWebDriver(driver);
driver.get("https://test.ru/iregistry/pages/serviceUse/view.xhtml?id=1337");
File f = $(By.xpath("//button/span[contains(text(), 'Скачать параметры')]")).download();
System.out.println(f.getName());
Логи и ошибка вот такая …
Starting ChromeDriver 2.45.615291 (ec3682e3c9061c10f26ea9e5cdcf3c53f3f74387) on port 6510
Only local connections are allowed.
авг 21, 2019 6:57:47 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
Exception in thread “main” java.lang.IllegalStateException: Cannot download file: proxy server is not started
at com.codeborne.selenide.commands.DownloadFile.execute(DownloadFile.java:48)
at com.codeborne.selenide.commands.DownloadFile.execute(DownloadFile.java:18)
at com.codeborne.selenide.commands.Commands.execute(Commands.java:144)
at com.codeborne.selenide.impl.SelenideElementProxy.dispatchAndRetry(SelenideElementProxy.java:99)
at com.codeborne.selenide.impl.SelenideElementProxy.invoke(SelenideElementProxy.java:65)
at com.sun.proxy.$Proxy3.download(Unknown Source)
at ru.sbt.cmdmvn.newPageObject.main(newPageObject.java:109)
Версии ОС и софта следующие …
win 7 chrome 71