-
Notifications
You must be signed in to change notification settings - Fork 11
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
Python Support? #87
Comments
For some reason, your session gets terminated.
I also see the element is not present after the entire timeout is completed
|
Do you have any recommendations on how to proceed? If I remove the plug-in and add say a 10 second sleep timer, then the element is located and interacted with, then re adding the plug in and removing the sleep timer I get this error. Thanks for your previous comment and any further advice would be great |
Can you share the code snippet and also fulllogs as gist please @kiebak3r |
Thanks @kiebak3r will look into it! I notice client is sending css-selector and server is converting the request to android-matcher. @KazuCocoa any idea? |
What's the client version? Usually Appium Python client won't do the conversion. It is selenium client's behavior. |
Currently running; Appium-Python-Client - 2.7.1 |
@KazuCocoa In this line https://gist.github.com/kiebak3r/b918fc5b67c9208a5c12dd0019ef9b1f#file-without-plugin-txt-L174 the client is first sending with css-selector as locator strategy later UI2Driver is sending 'android uiautomator' as strategy to server - https://gist.github.com/kiebak3r/b918fc5b67c9208a5c12dd0019ef9b1f#file-without-plugin-txt-L178 I see UIA2 is doing this parsing - https://github.com/appium/appium-uiautomator2-driver/blob/master/lib/css-converter.js#L293-L308 Do you know why we decided this approach? |
Python client sends css selector only when the find_element specifies it as https://github.com/appium/python-client/blob/fb8415edf11e5f7302e24df5c3354c0c69fe8776/appium/webdriver/webdriver.py#L379-L409
We haven't provided CSS selector (and had no plant to support it in the native implementation side). Instead, to support the syntax, Dan added the conversion in the JS layer to use existing method in the native layer but to support CSS syntax only |
Hm, latest https://github.com/SeleniumHQ/selenium/blob/b94159e08c5d45130ffa4cbe290d77fd6290a2d1/py/selenium/webdriver/remote/webdriver.py#L713 looks not break the existing behavior. I need to run the python client to see the behavior |
Any further update on this? I will mention I did some more testing & noticed that the structure used in the original gist continues to not work - But if I change the structure to use unit test framework then it works?? Any indication to why this might be the case?! |
I'm not a python person. @KazuCocoa can help |
I haven't figured this out yet but maybe python's resolving dependency stuff... |
Does this currently support python?
Integrated into my test suite & cannot get it to find the element, it times out..
I can see JS uses driver.findElement where as the python equivelant is driver.find_element
Is python supported or am i doing something wrong?!
Any help would be great.
Log:
--> POST /session/eea7fcc4-e676-4209-9c24-dbbd1eb3a4da/element
[HTTP] {"using":"css selector","value":"[id="com.yourdolphin.easyreader:id/intro_welcome_skip_button"]"}
[debug] [AndroidUiautomator2Driver@9e45 (eea7fcc4)] Calling AppiumDriver.findElement() with args: ["css selector","[id="com.yourdolphin.easyreader:id/intro_welcome_skip_button"]","eea7fcc4-e676-4209-9c24-dbbd1eb3a4da"]
[AppiumDriver@0a01] Plugins which can handle cmd 'findElement': element-wait
[AppiumDriver@0a01] Plugin element-wait is now handling cmd 'findElement'
| Waiting to find element with css selector strategy for [id="com.yourdolphin.easyreader:id/intro_welcome_skip_button"] selector[HTTP] --> GET /session/bf4942bf-5ca8-4b62-aed4-fafeadf612c3/timeouts
[HTTP] {}
[debug] [AppiumDriver@0a01] Encountered internal error running command: NoSuchDriverError: A session is either terminated or not started
[debug] [AppiumDriver@0a01] at asyncHandler (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules@appium\base-driver\lib\protocol\protocol.js:315:15)
[debug] [AppiumDriver@0a01] at C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules@appium\base-driver\lib\protocol\protocol.js:518:15
[debug] [AppiumDriver@0a01] at Layer.handle [as handle_request] (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\layer.js:95:5)
[debug] [AppiumDriver@0a01] at next (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\route.js:144:13)
[debug] [AppiumDriver@0a01] at Route.dispatch (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\route.js:114:3)
[debug] [AppiumDriver@0a01] at Layer.handle [as handle_request] (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\layer.js:95:5)
[debug] [AppiumDriver@0a01] at C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:284:15
[debug] [AppiumDriver@0a01] at param (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:365:14)
[debug] [AppiumDriver@0a01] at param (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:376:14)
[debug] [AppiumDriver@0a01] at Function.process_params (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:421:3)
[debug] [AppiumDriver@0a01] at next (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:280:10)
[debug] [AppiumDriver@0a01] at logger (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\morgan\index.js:144:5)
[debug] [AppiumDriver@0a01] at Layer.handle [as handle_request] (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\layer.js:95:5)
[debug] [AppiumDriver@0a01] at trim_prefix (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:328:13)
[debug] [AppiumDriver@0a01] at C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:286:9
[debug] [AppiumDriver@0a01] at Function.process_params (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:346:12)
[debug] [AppiumDriver@0a01] at next (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:280:10)
[debug] [AppiumDriver@0a01] at jsonParser (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\body-parser\lib\types\json.js:113:7)
[debug] [AppiumDriver@0a01] at Layer.handle [as handle_request] (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\layer.js:95:5)
[debug] [AppiumDriver@0a01] at trim_prefix (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:328:13)
[debug] [AppiumDriver@0a01] at C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:286:9
[debug] [AppiumDriver@0a01] at Function.process_params (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:346:12)
[HTTP] <-- GET /session/bf4942bf-5ca8-4b62-aed4-fafeadf612c3/timeouts 404 26 ms - 3231
[HTTP]
× Waiting to find element with css selector strategy for [id="com.yourdolphin.easyreader:id/intro_welcome_skip_button"] selector
[AppiumDriver@0a01] Command 'findElement' was not handled by the following behaviours or plugins, even though they were registered to handle it: ["default"]. The command was handled by these: ["element-wait"].
[debug] [AndroidUiautomator2Driver@9e45 (eea7fcc4)] Encountered internal error running command: NoSuchElementError: Time out after waiting for element [id="com.yourdolphin.easyreader:id/intro_welcome_skip_button"] for 10000 ms
[debug] [AndroidUiautomator2Driver@9e45 (eea7fcc4)] at C:\Users\kieba.appium\node_modules\appium-wait-plugin\lib\element.js:73:23
[debug] [AndroidUiautomator2Driver@9e45 (eea7fcc4)] at Generator.throw ()
[debug] [AndroidUiautomator2Driver@9e45 (eea7fcc4)] at rejected (C:\Users\kieba.appium\node_modules\appium-wait-plugin\lib\element.js:6:65)
[HTTP] <-- POST /session/eea7fcc4-e676-4209-9c24-dbbd1eb3a4da/element 404 10020 ms - 540
The text was updated successfully, but these errors were encountered: