Тестирую этот проект https://github.com/aerokube/demo-tests
Запущенные контейнеры
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ffd64121947a aerokube/selenoid:latest "/usr/bin/selenoid -…" 3 days ago Up 3 days 0.0.0.0:4444->4444/tcp selenoid
c7c74a3b6589 aerokube/selenoid-ui:latest "/selenoid-ui --sele…" 3 days ago Up 3 days 0.0.0.0:8080->8080/tcp selenoid-ui
Логи ffd64121947a
docker logs ffd64121947a
2019/12/02 12:16:03 [3258] [LOCATING_SERVICE] [chrome] [6.0]
2019/12/02 12:16:03 [3258] [ENVIRONMENT_NOT_AVAILABLE] [chrome] [6.0]
browsers.json:
{
"android": {
"default": "6.0",
"versions": {
"6.0": {
"image": "nexus/selenoid/android:6.0",
"port": "4444",
"path": "/wd/hub"
}
}
},
"chrome": {
"default": "78.0",
"versions": {
"78.0": {
"image": "nexus/selenoid/chrome:78.0",
"port": "4444",
"path": "/"
}
}
}
}
Прокси поправил
package com.aerokube.selenoid;
import org.apache.commons.io.FileUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.*;
import org.openqa.selenium.remote.Augmenter;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import java.io.File;
import java.net.URL;
import static com.aerokube.selenoid.Screenshot.takeScreenshot;
public class DemoTest {
private RemoteWebDriver driver;
@Before
public void openDriver() throws Exception {
Proxy proxy = new Proxy();
proxy.setSslProxy("http://proxy:3128");
final DesiredCapabilities browser = DesiredCapabilities.chrome();
browser.setCapability("deviceName", "android");
browser.setCapability("version", "6.0");
browser.setCapability("appPackage", "com.android.chrome");
browser.setCapability("appActivity", "com.google.android.apps.chrome.Main");
browser.setCapability("proxy", proxy);
browser.setCapability("enableVideo", true);
browser.setCapability("enableLog", true);
browser.setCapability("enableVNC", true);
driver = new RemoteWebDriver(new URL(
"http://localhost:4444/wd/hub" //Replace with correct host and port
), browser);
}
@Test
public void browserTest() throws Exception {
try {
driver.get("https://duckduckgo.com/");
WebElement input = driver.findElement(By.cssSelector("input#search_form_input_homepage"));
input.sendKeys(Keys.chord("selenium", Keys.ENTER));
} finally {
takeScreenshot(driver);
}
}
@After
public void closeDriver(){
if (driver != null){
driver.quit();
driver = null;
}
}
}
Пишет:
Tests in error:
browserTest(com.aerokube.selenoid.DemoTest): Requested environment is not available (WARNING: The server did not provide any stacktrace information)
Как исправить ошибку?