selenium.common.exceptions.NoSuchElementException: Message: An element could not be located on the page using the given search parameters

I am able to launch application. i.e splacescreen
when loginActivity apperas it have two pop for assing permission . i am able to perfoem click using python script . but when plan loginscreen appear it gives me this error
button = driver.find_elements_by_class_name(“android.widget.Button”)

Can you paste your Python test script here?

from appium import webdriver
import time
import os

PATH = lambda p: os.path.abspath(
os.path.join(os.path.dirname(file), p))
desired_caps = {}
desired_caps[‘platformName’] = ‘Android’
#desired_caps[‘appiumVersion’] = ‘’
#desired_caps[‘platformVersion’] = ‘4.2’
desired_caps[‘deviceName’] = ‘520377bf4269b355’
desired_caps[‘noReset’] = True
#desired_caps[‘app’] = PATH(‘xxx.apk’);
desired_caps[‘appPackage’] = ‘’
desired_caps[‘appActivity’] = ‘’
driver = webdriver.Remote(‘’, desired_caps)

Test Actions here…


button = driver.find_elements_by_class_name(“android.widget.Button”)

button1 = driver.find_elements_by_class_name(“android.widget.Button”)


print button2


button2 print [ ] null array

Assuming you are trying to click on the ‘Login’ button, can you try this?

button2 = driver.find_element_by_xpath('//android.widget.Button[@text = "LOGIN"]')
print button2

If you want to click on the Login button:

button2 = driver.find_element_by_xpath('//android.widget.Button[@text = "LOGIN"]')

appium terminal shows
[debug] [MJSONWP] Calling AppiumDriver.findElement() with args: [“xpath”,"//andr
oid.widget.Button[@text = “LOGIN”]",“ff49d83b-635f-4073-8731-3717fca178d1”]
[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 15000 ms for condition
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:
“find”,“params”:{“strategy”:“xpath”,“selector”:"//android.widget.Button[@text =
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:
et.Button[@text = “LOGIN”]",“context”:"",“multiple”:false}}
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘//android.widget.But
ton[@text = “LOGIN”]’ using ‘XPATH’ with the contextId: ‘’ multiple: false

its not going ahead

************when loginActivity launch appium shows

[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Failed to locate element. Cle
aring Accessibility cache and retrying.
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘android.widget.Butto
n’ using ‘CLASS_NAME’ with the contextId: ‘’ multiple: true
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=andro
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelect
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (0)
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSe
lector[CLASS=android.widget.Button, INSTANCE=0]

can you click on the ‘Login’ button in your uiautomator tool and share a screenshot.

i am able to run after change android device having M version.
previos version was N

now i am able to sendkey to username and password . but keyboard hide login button .
not able to click on login.
====Please Help======

driver.find_element_by_id(“com.***:id/editTextPwd”).send_keys(‘[email protected]’)


oh that’s great. For click login button does appium says element not found?

there is no error.
But why it is not working on andorid N?
i have latest appium version

add this to your desired capabilities

automationName: 'uiautomator2'

Thanks . working on both devices.
desired_caps[‘automationName’] = ‘uiautomator2’
install uiatomator2 and set JAVA_HOME

I am not able to access webview element using uiautomator2.
i have added webview in android screen
it is possible in default uiatomator
Please help


Hey, tried several ways to find my element, error still shows up.

  1. From the below list , tried all locator strategy, but no help.

#elu = driver.find_element_by_xpath("//*[contains(@text, ‘Baddebt Collection’)]")

elv = driver.find_element_by_xpath(’//android.widget.TextView[@text= “Baddebt Collection”]’)

#elk = driver.find_element_by_name(“Baddebt Collection”)

#el78 = driver.find_element_by_id(“”)

#elb = driver.find_element_by_xpath("//*[@name=‘Baddebt Collection’]")

The clickable flag shows ‘False’ in the inspector. Can you check with your developers to see if they can set it to True and retry?