Skip to content

Java Client, Appium and Win 10 issue #530

Closed

Description

@amitg25

I am trying to run Calculator App (java version) with WinAppDriver 0.5, but I see following issues with Appium.

When I declare my variables as IOSDriver (As mentioned on the description)

private static IOSDriver CalculatorSession = null;
private static WebElement CalculatorResult = null;
with following capabilities

capabilities.setCapability("app", "Microsoft.WindowsCalculator_8wekyb3d8bbwe!App");
capabilities.setCapability("platformName", "Windows");
capabilities.setCapability("deviceName", "WindowsPC");

I keep getting iOS driver and exception
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not find path to Xcode by symlinks located in /var/db/xcode_select_link, or /usr/share/xcode-select/xcode_dir_link (WARNING: The server did not provide any stacktrace information)

Now if I change it to
private static RemoteWebDriver CalculatorSession = null;
private static RemoteWebElement CalculatorResult = null;

It starts working but now WinAppDriver fails to getText from screen. Following line fails
final String xPath = "//*[@AutomationId='CalculatorResults']";
String text = CalculatorSession.findElementByXPath(xPath).getText();

I tried changing xpath to different ways like
//windows[@name='Display is 7 '];
//*[@name='Display is 7 '];
but none worked.
however when I call CalculatorSession.findElementByName("Seven").click();, this run successfully.

Can someone suggest what's wrong in here? To me it looks like driver issue.

Env:
Windows 10 Laptop
Version 1511
OS Build: 10586.679
Appium Ver: 1.6.1
Win App Driver: 0.5

This can be reproduce with Calculator Java version of App from WindowsAppDriver Sample tests.

Activity

  1. amitg25 commented on Dec 1, 2016

    @amitg25
    Author

    I received this response from Jlipps on Appium Server side.

    jlipps commented 7 minutes ago
    I think declaring it as ios driver is causing the capabilities to be wrong somehow. At any rate this is not a server issue but a java-client issue, so if you think there's a bug, please report it at https://github.com/appium/java-client/issues.

  2. amitg25 commented on Dec 1, 2016

    @amitg25
    Author

    Here are the logs

    [Appium] Welcome to Appium v1.6.1
    [Appium] Appium REST http interface listener started on 0.0.0.0:4723
    [HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"app":"Microsoft.WindowsCalculator_8wekyb3d8bbwe!App","platformName":"Windows","deviceName":"WindowsPC"}}
    [debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"Microsoft.WindowsCalculator_8wekyb3d8bbwe!App","platformName":"Windows","deviceName":"WindowsPC"},null,null,null,null]
    [Appium] Creating new WindowsDriver session
    [Appium] Capabilities:
    [Appium] app: 'Microsoft.WindowsCalculator_8wekyb3d8bbwe!App'
    [Appium] platformName: 'Windows'
    [Appium] deviceName: 'WindowsPC'
    [BaseDriver] The following capabilities were provided, but are not recognized by appium: app.
    [BaseDriver] Session created with session id: d6a2889c-9021-40b4-bde1-f4035f1c710b
    [WinAppDriver] Verifying WinAppDriver is installed with correct checksum
    [debug] [WinAppDriver] Deleting WinAppDriver session
    [MJSONWP] Encountered internal error running command: Error: Could not verify WinAppDriver install; re-run install
    at WinAppDriver.start$ (lib/winappdriver.js:35:13)
    at tryCatch (C:\Users\agupta\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\agupta\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\agupta\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (C:\Users\agupta\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
    [HTTP] <-- POST /wd/hub/session 500 93 ms - 190
    [HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"app":"Microsoft.WindowsCalculator_8wekyb3d8bbwe!App","platformName":"iOS","deviceName":"WindowsPC"}}
    [debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"Microsoft.WindowsCalculator_8wekyb3d8bbwe!App","platformName":"iOS","deviceName":"WindowsPC"},null,null,null,null,null,null]
    [Appium] Creating new IosDriver session
    [Appium] Capabilities:
    [Appium] app: 'Microsoft.WindowsCalculator_8wekyb3d8bbwe!App'
    [Appium] platformName: 'iOS'
    [Appium] deviceName: 'WindowsPC'
    [debug] [iOS] IosDriver version: 1.13.0
    [BaseDriver] Session created with session id: 615e7f47-a463-4cf3-80a1-0d357ce9a1c2
    [Xcode] Finding XcodePath by symlink because Error: Command 'xcode-select --print-path' errored out: Error: spawn xcode-select ENOENT
    at exports._errnoException (util.js:1008:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:182:32)
    at onErrorNT (internal/child_process.js:348:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
    [Xcode] Could not find path to Xcode by symlinks located in /var/db/xcode_select_link, or /usr/share/xcode-select/xcode_dir_link
    [debug] [iOS] Error: Could not find path to Xcode by symlinks located in /var/db/xcode_select_link, or /usr/share/xcode-select/xcode_dir_link
    at getPathFromSymlink$ (lib/xcode.js:79:9)
    at tryCatch (C:\Users\agupta\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\agupta\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\agupta\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (C:\Users\agupta\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
    Error: Could not find path to Xcode by symlinks located in /var/db/xcode_select_link, or /usr/share/xcode-select/xcode_dir_link
    at getPathFromSymlink$ (lib/xcode.js:79:9)
    at tryCatch (C:\Users\agupta\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\agupta\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\agupta\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (C:\Users\agupta\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
    [iOS] Could not determine Xcode version: Could not find path to Xcode by symlinks located in /var/db/xcode_select_link, or /usr/share/xcode-select/xcode_dir_link
    [MJSONWP] Encountered internal error running command: Error: Could not find path to Xcode by symlinks located in /var/db/xcode_select_link, or /usr/share/xcode-select/xcode_dir_link
    at getPathFromSymlink$ (lib/xcode.js:79:9)
    at tryCatch (C:\Users\agupta\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\agupta\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\agupta\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (C:\Users\agupta\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
    [HTTP] <-- POST /wd/hub/session 500 170 ms - 257

  3. jlipps commented on Dec 1, 2016

    @jlipps
    Member

    The problem is that you're trying to start a session twice, and the second time you're passing in a platformName of iOS (or the java client is doing that on its own somehow, maybe as part of a retry mechanism).

  4. amitg25 commented on Dec 1, 2016

    @amitg25
    Author

    Thanks Jlipps, i did confirm I am not setting platformName=iOS anywhere in the code infect it's few lines of code only in the existing CalculatorTest sample app. Second I am sure that findElementForXPath is not working for java client, even simple calls like //*[@name='Next'] is failing with exception. So seems like java client issue.

  5. amitg25 commented on Dec 1, 2016

    @amitg25
    Author

    This is the log from appium console.

    [WinAppDriver] [STDOUT] {"sessionId":"6A1DB7D8-5236-43D4-B103-9A30B15B4156","status":0}
    [debug] [JSONWP Proxy] Got response with status 200: "{"sessionId":"6A1DB7D8-5236-43D4-B103-9A30B15B4156","status":0}"
    [WinAppDriver] Did not get confirmation WinAppDriver deleteSession worked; Error was: Error: Did not get a valid response object. Object was: {"sessionId":"6A1DB7D8-5236-43D4-B103-9A30B15B4156","status":0}
    [debug] [WinAppDriver] WinAppDriver changed state to 'stopping'
    [debug] [WinAppDriver] WinAppDriver changed state to 'stopped'
    [Appium] Removing session 4dfbd252-8580-45de-87c7-5f055cf7139a from our master session list
    [debug] [MJSONWP] Received response: null
    [debug] [MJSONWP] But deleting session, so not returning
    [debug] [MJSONWP] Responding to client with driver.deleteSession() result: null
    [HTTP] <-- DELETE /wd/hub/session/4dfbd252-8580-45de-87c7-5f055cf7139a 200 82 ms - 76

  6. TikhomirovSergey commented on Dec 2, 2016

    @TikhomirovSergey
    Contributor

    @jlipps @amitg25 We (I am and @SrinivasanTarget ) are working on enhancements:

    • non abstract AppiumDriver
    • adding the WindowsDriver.

    I think declaring it as ios driver is causing the capabilities to be wrong somehow.

    There is the string (there are similar strings)
    https://github.com/appium/java-client/blob/master/src/main/java/io/appium/java_client/ios/IOSDriver.java#L76

    It is not the bug. It had been normal until Windows and youiengine automations were added. So it is just the case that we are implementing.

  7. TikhomirovSergey commented on Dec 2, 2016

    @TikhomirovSergey
    Contributor
  8. TikhomirovSergey commented on Dec 6, 2016

    @TikhomirovSergey
    Contributor
  9. TikhomirovSergey commented on Dec 17, 2016

    @TikhomirovSergey
    Contributor

    This issue was resolved by #538. It is going to be published in 5.0.0-beta1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions