In all the cases above, i got an error that element cannot be found. Is there something specific i need to do in order to select ui element according to content-desc? Note that I am using Appium 1.3.4.1.
thanks for the reply. I don’t know what i did different but pay_now_button = driver.find_element_by_android_uiautomator(‘new UiSelector().description(“pay now”)’) now works.
One other issue i am having is trying to get the value in content-desc. So i have this code:
The first line works fine as I checked that it return the correct object. For the get_attribute call, I get an error that element could not be found using that search parameter.
Is this something not supported yet in Appium 1.3.4.1 or the python client version (Appium_Python_Client-0.11-py3.3) i am using?
The text field for this element is actually empty in this case so i need to get actual value of content-desc field. However, when i try payment_success.get_attribute(‘content-desc’), it gives me the error.
I finally found the solution to my get_attribute() issue. It seems I need to use get_attribute(“name”) in order to get the value in the content-desc field of element.