separate find_element/s for uiautomator and xpath#547
separate find_element/s for uiautomator and xpath#547KazuCocoa merged 5 commits intoappium:masterfrom
Conversation
|
Thanks for fixing the issue <3 |
|
@Edouard-chin Could you run this branch? |
|
@KazuCocoa I setup our CI to target this branch, will let you know the results after few builds |
|
Ran our automation 4 times, one failed. appium_driver.button('Done').clickAppium logs[HTTP] --> POST /wd/hub/session/06e737c1-640a-4ba3-b2d7-cf5822c3aad3/element {"using":"xpath","value":"//android.widget.Button[contains(translate(@text,'DONE', 'Done'), 'Done') or contains(translate(@content-desc,'DONE', 'Done'), 'Done')]|android.widget.ImageButton[contains(translate(@text,'DONE', 'Done'), 'Done') or contains(translate(@content-desc,'DONE', 'Done'), 'Done')]"} [debug] [MJSONWP] Calling AppiumDriver.findElement() with args: ["xpath","//android.widget.Button[contains(translate(@text,'DONE', 'Done'), 'Done') or contains(translate(@content-desc,'DONE', 'Done'), 'Done')]|android.widget.ImageButton[contains(translate(@text,'DONE', 'Done'), 'Done') or contains(translate(@content-desc,'DONE', 'Done'), 'Done')]","06e737c1-640a-4ba3-b2d7-cf5822c3aad3"] [debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator [debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator [debug] [BaseDriver] Waiting up to 0 ms for condition [debug] [AndroidBootstrap] Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//android.widget.Button[contains(translate(@text,'DONE', 'Done'), 'Done') or contains(translate(@content-desc,'DONE', 'Done'), 'Done')]|android.widget.ImageButton[contains(translate(@text,'DONE', 'Done'), 'Done') or contains(translate(@content-desc,'DONE', 'Done'), 'Done')]","context":"","multiple":false}} [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//android.widget.Button[contains(translate(@text,'DONE', 'Done'), 'Done') or contains(translate(@content-desc,'DONE', 'Done'), 'Done')]|android.widget.ImageButton[contains(translate(@text,'DONE', 'Done'), 'Done') or contains(translate(@content-desc,'DONE', 'Done'), 'Done')]","context":"","multiple":false}} [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding '//android.widget.Button[contains(translate(@text,'DONE', 'Done'), 'Done') or contains(translate(@content-desc,'DONE', 'Done'), 'Done')]|android.widget.ImageButton[contains(translate(@text,'DONE', 'Done'), 'Done') or contains(translate(@content-desc,'DONE', 'Done'), 'Done')]' using 'XPATH' with the contextId: '' multiple: false [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":7,"value":"Could not find an element using supplied strategy. "} |
|
I forgot checking automationName for I also check this PR carefully after my work. |
|
Ran the automation 8 times and no failures. I think it's working correctly. Nice work 🎉 |
|
Thanks! |
|
For my own curiosity, why does the |
|
I don't know well... @jlipps Do you know the reason why XPath is unstable than UIAutomator for Android? |
|
I cannot say anything for sure without having logs and page sources. |

fix: 9.4.0 release sudden failures #546
ref- https://github.com/appium/ruby_lib/pull/544/files