I'm trying to test a Phonegap Application, and I need to navigate throught HTML instead of Android components. To make this, I'm setting up hybrid testing with the following capabilities:
private static AndroidDriver<WebElement> driver;
public static void initDriver() throws MalformedURLException {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("appium-version", "1.4.16.1");
capabilities.setCapability("automationName", "Appium");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("platformVersion", "5.1");
capabilities.setCapability("deviceName", "Android Emulator");
capabilities.setCapability("browserName", "Chrome");
capabilities.setCapability("fullReset", true);
capabilities.setCapability("app", myApp);
driver = new AndroidDriver<>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
Set<String> contextNames = driver.getContextHandles();
for(String contextName : contextNames) {
System.out.println("Contexto autorizado: " + contextName);
}
driver.context("WEBVIEW_com.pinea.ClaveiSAT");
}
The problem is when I launch a test through Appium App and starts the Chrome Driver doesn't respond to status command. And the good thing is when I start Chrome Driver via CMD, I get the response. Same executable, same URL, different behaviors.
Here it is the log from Appium Application:
info: Chromedriver: Changed state to 'starting'
info: Chromedriver: Set chromedriver binary as: C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win\chromedriver.exe
info: Chromedriver: Killing any old chromedrivers, running: FOR /F "usebackq tokens=5" %a in (netstat -nao ^| findstr /R /C:"9515 ") do (FOR /F "usebackq" %b in (TASKLIST /FI "PID eq %a" ^| findstr /I chromedriver.exe) do (IF NOT %b=="" TASKKILL /F /PID %a))
info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":"\/data\/local\/tmp"}
info: Chromedriver: No old chromedrivers seemed to exist
info: Chromedriver: Spawning chromedriver with: C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win\chromedriver.exe --url-base=wd/hub --port=9515
info: Chromedriver: [STDOUT] Starting ChromeDriver 2.20.353145 (343b531d31eeb933ec778dbcf7081628a1396067) on port 9515
Only local connections are allowed.
info: JSONWP Proxy: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
info: JSONWP Proxy: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
info: JSONWP Proxy: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
info: JSONWP Proxy: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
error: Chromedriver: Chromedriver exited unexpectedly with code null, signal SIGTERM
info: Chromedriver: Changed state to 'stopped'
info: Chromedriver stopped unexpectedly on us, shutting down then calling back up with the on-die callback
error: Chromedriver: Error: Could not proxy command to remote server. Original error: 503 -
And my environment specifications:
OS: Windows
Appium Version: 1.4.16.1
Chrome Driver Version: 2.20
Device: Motorola Moto G Android 5.1
Thank you in advance for your answers.