Собственно сама ошибка в ide
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Command ‘java -version’ exited with code 2
В консоли appium:
Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session
[HTTP] {“desiredCapabilities”:{“browserName”:“chrome”,“platformName”:“Android”,“deviceName”:“Pixel”,“platformVersion”:“7.0”},“capabilities”:{“desiredCapabilities”:{“browserName”:“chrome”,“deviceName”:“Pixel”,“platformName”:“Android”,“platformVersion”:“7.0”},“firstMatch”:[{“browserName”:“chrome”,“platformName”:“android”}]}}
[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{“browserName”:“chrome”,“platformName”:“Android”,“deviceName”:“Pixel”,“platformVersion”:“7.0”},null,{“desiredCapabilities”:{“browserName”:“chrome”,“deviceName”:“Pixel”,“platformName”:“Android”,“platformVersion”:“7.0”},“firstMatch”:[{“browserName”:“chrome”,“platformName”:“android”}]}]
[debug] [BaseDriver] Event ‘newSessionRequested’ logged at 1536832260579 (12:51:00 GMT+0300 (Финляндия (лето)))
[Appium] Could not parse W3C capabilities: ‘deviceName’ can’t be blank
[Appium] Trying to fix W3C capabilities by merging them with JSONWP caps
[BaseDriver] The capabilities [“deviceName”,“platformVersion”] are not standard capabilities and should have an extension prefix
[Appium] Consider setting ‘automationName’ capability to ‘UiAutomator2’ on Android >= 6, since UIAutomator framework is not maintained anymore by the OS vendor.
[Appium] Creating new AndroidDriver (v3.7.0) session
[Appium] Capabilities:
[Appium] deviceName: Pixel
[Appium] platformVersion: 7.0
[Appium] browserName: chrome
[Appium] platformName: android
[debug] [BaseDriver] W3C capabilities {“alwaysMatch”:{"appium:dev… and MJSONWP desired capabilities {“browserName”:“chrome”,"pl… were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {“alwaysMatch”:{"appium:dev…
[BaseDriver] Session created with session id: 23791da5-4b7c-49a1-a549-524244fbff32
[debug] [AndroidDriver] Shutting down Android driver
[debug] [AndroidDriver] Called deleteSession but bootstrap wasn’t active
[debug] [BaseDriver] Event ‘newSessionStarted’ logged at 1536832260650 (12:51:00 GMT+0300 (Финляндия (лето)))
[W3C] Encountered internal error running command: Error: Command ‘java -version’ exited with code 2
[W3C] at ChildProcess. (C:\Users\n111k\AppData\Roaming\npm\node_modules\appium\node_modules\teen_process\lib\exec.js:94:19)
[W3C] at emitTwo (events.js:125:13)
[W3C] at ChildProcess.emit (events.js:213:7)
[W3C] at maybeClose (internal/child_process.js:927:16)
[W3C] at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
[HTTP] <-- POST /wd/hub/session 500 88 ms - 1355
Код теста:
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;
import io.appium.java_client.ios.IOSDriver;
import io.appium.java_client.remote.MobileCapabilityType;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.support.ui.WebDriverWait;
import java.net.URL;
public class MobileTest {
private WebDriver driver;
@Before
public void setUp() throws Exception {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName", "Pixel");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("platformVersion", "7.0");
capabilities.setCapability("browserName", "chrome");
driver = new AndroidDriver<>(new URL("http://127.0.0.1:4723/wd/hub"),
capabilities);
//driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}
@Test
public void testMoyo() throws Exception {
driver.get("my url");
Thread.sleep(1000);
driver.findElement(By.cssSelector(".cart-inner-link")).click();
System.out.println(driver.getCurrentUrl());
}
@After
public void tearDown() throws Exception {
driver.quit();
}
}