Reputation: 11
This is my first post so I did some research before asking this question, but it was all in vaine. I'm writing my python script for Android application and I need to use basic click() command, in order to get deeper.
Android 6.0.1 (xiaomi redmi note 3 pro), SDK installed for Android 6.0, python 3.6.1, Appium 1.0.2 + Pycharm. Element is localized with no problems, but click() doesn't work, nothing happens.
Part of my script:
driver.find_element_by_id('com.socialnmobile.dictapps.notepad.color.note:id/main_btn1').click()
I tried to use .tap()
instead, but it says "AttributeError: 'WebElement' object has no attribute 'tap'".
I would be very grateful for your help, cause I'm stuck with it for good.
Upvotes: 0
Views: 423
Reputation: 11
Ok, after a long fight I came up with the solution. My smartphone - Xiaomi Redmi Note 3 Pro apart from standard USB Debugging option in settings, has another USB Debugging (security option). It has to be enabled as well, cause the second option protects smartphone from remote moves. Regards.
Upvotes: 1
Reputation: 2063
Try this
driver.find_element_by_id('main_btn1').click()
Find the ID mentioned under the resource id in case you are using appium version less than 1.0.2
You are pasting the whole package id com.socialnmobile.dictapps.notepad.color.note:id/main_btn1
which appium wont detect because that is certainly not the element id.
In case this doesnt work, please let me know the contents you see in the inspector.
Upvotes: 0