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

getSize not working in Linux appium 1.9.1 #11619

Closed
MummanaSubramanya opened this issue Nov 2, 2018 · 15 comments
Closed

getSize not working in Linux appium 1.9.1 #11619

MummanaSubramanya opened this issue Nov 2, 2018 · 15 comments
Labels
Android related to Android-native driver(s) Enhancement feature W3C regarding W3C specification compliance

Comments

@MummanaSubramanya
Copy link

The problem

I have hybrid app and Im trying the below method
MobileDriver.FindElement(LocateElement(type, object)).Size which works fine when running in windows machine with appium server 1.9.1 here is the windows gist When I try to run the same code in Linux machine with appium server 1.9.1 it fails with error "Unknown command". Here is the gist for linux appium server linux gist

Environment

  • Appium version (or git revision) that exhibits the issue: 1.9.1
  • Last Appium version that did not exhibit the issue (if applicable): 1.8.1
  • Desktop OS/version used to run Appium: Linux and Windows 10
  • Node.js version (unless using Appium.app|exe):
  • Mobile platform/version under test: Android o
  • Real device or emulator/simulator: real
  • Appium CLI or Appium.app|exe: CLI for linux and Exe for windows

Details

<add key="AppiumServer" value="127.0.0.1" /> <add key="AppiumServerPort" value="4723" /> <add key="PlatformName" value="Android" /> <add key="AutomationName" value="uia" /> <add key="PlatformVersion" value="8.0" /> <add key="DeviceName" value="xxxxxxx" /> <add key="AppPackage" value="com.xxx.xxx" /> <add key="AppActivity" value=".MainActivity" /> <add key="AutoWebview" value="true" />

@mykola-mokhnach
Copy link
Collaborator

Try appium@beta

@mykola-mokhnach mykola-mokhnach added the Needs Info typically non-actionable; needs author to respond label Nov 2, 2018
@MummanaSubramanya
Copy link
Author

MummanaSubramanya commented Nov 2, 2018

updated the linux appium to version appium1.9.2-beta still facing the issue.

[W3C (3244b5c7)] Driver proxy active, passing request on via HTTP proxy [debug] [JSONWP Proxy] Matched '/wd/hub/session/3244b5c7-dc47-43d5-ace3-03ae0c86befe/element/0.5961594775190369-15/rect' to command name 'getElementRect' [debug] [JSONWP Proxy] Proxying [GET /wd/hub/session/3244b5c7-dc47-43d5-ace3-03ae0c86befe/element/0.5961594775190369-15/rect] to [GET http://127.0.0.1:8000/wd/hub/session/565a3e30785450e6bc286486136ceea9/element/0.5961594775190369-15/rect] with body: {} [JSONWP Proxy] Got an unexpected response: unknown command: session/565a3e30785450e6bc286486136ceea9/element/0.5961594775190369-15/rect [debug] [W3C (3244b5c7)] Encountered internal error running command: Error: Could not proxy. Proxy error: Could not proxy command to remote server. Original error: 404 - "unknown command: session/565a3e30785450e6bc286486136ceea9/element/0.5961594775190369-15/rect" [debug] [W3C (3244b5c7)] at /home/pi/node_modules/appium-base-driver/lib/protocol/protocol.js:550:13 [debug] [W3C (3244b5c7)] at Generator.next (<anonymous>) [debug] [W3C (3244b5c7)] at asyncGeneratorStep (/home/pi/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24) [debug] [W3C (3244b5c7)] at _next (/home/pi/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9) [debug] [W3C (3244b5c7)] at <anonymous> [HTTP] <-- GET /wd/hub/session/3244b5c7-dc47-43d5-ace3-03ae0c86befe/element/0.5961594775190369-15/rect 500 32 ms - 1054 [HTTP] [HTTP] --> GET /wd/hub/session/3244b5c7-dc47-43d5-ace3-03ae0c86befe/screenshot [HTTP] {}

@mykola-mokhnach
Copy link
Collaborator

What is appium-xcuitest-driver component version?

@MummanaSubramanya
Copy link
Author

how come appium-xcuitest-driver comes into picture its and android device and automation name
is UIautomator2

@mykola-mokhnach
Copy link
Collaborator

If this is uiautomator2 driver then you could try to replace the call to getRect with getLocation/getSize , since chromedriver itself does not support the /rect endpoint.

@mykola-mokhnach mykola-mokhnach added ThirdParty upstream problems Mobile Chrome related to mobile Chrome driver and removed Needs Info typically non-actionable; needs author to respond labels Nov 2, 2018
@MummanaSubramanya
Copy link
Author

MummanaSubramanya commented Nov 2, 2018

Im using c# 'MobileDriver.FindElement(LocateElement(type, object)).Size' is the command im using. Im not using the rect command . If the command was an issue it should fail in both linux and windows.

@mykola-mokhnach
Copy link
Collaborator

mykola-mokhnach commented Nov 2, 2018

It probably calls getRect internally

@mykola-mokhnach mykola-mokhnach added Enhancement feature Android related to Android-native driver(s) UIAutomator2 specific to uiautomator2 driver labels Nov 2, 2018
@MummanaSubramanya
Copy link
Author

so its an implementation issue?

@mykola-mokhnach
Copy link
Collaborator

I think it might be handled on both sides. For iOS the driver has been patched to "split" /rect call in web context into /location + /size. I'm not quite sure if the same trick could be done for Android. Although patching this on driver level will allow to void possible issues with all clients and not only the .NET one.

@imurchie Perhaps you have more ideas on a possible fix?

@MummanaSubramanya
Copy link
Author

Im still not able to understand the code works fine with Windows Appium server 1.9.1 and it fails with Linux Appium server 1.9.1 -- I believe the server code is same for all platforms

@laolubenson
Copy link
Contributor

@mykola-mokhnach I think it calls getRect internally, I saw this a while back. It got replaced as part of the W3C changes. Will calling /location/size work in a web context?

@mykola-mokhnach
Copy link
Collaborator

It will, but patching that would only fix the problem for .net client. Let see if we can patch it on driver level first

@MummanaSubramanya
Copy link
Author

@akinsolb : sorry but can i expect this fix at early?

@mykola-mokhnach
Copy link
Collaborator

I have published the patch for uia2 in appium@beta

@mykola-mokhnach mykola-mokhnach added W3C regarding W3C specification compliance and removed UIAutomator2 specific to uiautomator2 driver Mobile Chrome related to mobile Chrome driver ThirdParty upstream problems labels Nov 13, 2018
@lock
Copy link

lock bot commented Mar 27, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android related to Android-native driver(s) Enhancement feature W3C regarding W3C specification compliance
Projects
None yet
Development

No branches or pull requests

4 participants