Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java Client, Appium and Win 10 issue #530

Closed
amitg25 opened this issue Dec 1, 2016 · 9 comments
Closed

Java Client, Appium and Win 10 issue #530

amitg25 opened this issue Dec 1, 2016 · 9 comments

Comments

@amitg25
Copy link

amitg25 commented Dec 1, 2016

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.

@amitg25
Copy link
Author

amitg25 commented Dec 1, 2016

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.

@amitg25
Copy link
Author

amitg25 commented Dec 1, 2016

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

@jlipps
Copy link
Member

jlipps commented Dec 1, 2016

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).

@amitg25
Copy link
Author

amitg25 commented Dec 1, 2016

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.

@amitg25
Copy link
Author

amitg25 commented Dec 1, 2016

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

@TikhomirovSergey
Copy link
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.

@TikhomirovSergey
Copy link
Contributor

#471
#454

@TikhomirovSergey
Copy link
Contributor

#532

@TikhomirovSergey TikhomirovSergey mentioned this issue Dec 16, 2016
4 tasks
@TikhomirovSergey
Copy link
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
Projects
None yet
Development

No branches or pull requests

3 participants