Not able to find elements using any locators for my mobile app


Hello ,

I am not able find elements of my mobile app either from ID,X-PATH or classname

getting below exception

attached screenshot of code and app elements

please help in resolving the same

thanks in advance

Exception in thread “main” org.openqa.selenium.NoSuchElementException: An element could not be located on the page using the given search parameters.

For documentation on this error, please visit:

Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:48’

System info: host: ‘AGI-LT-915’, ip: ‘’, ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_201’

Driver info:

Capabilities {app: D:\selenium\Workspace\eCOA…, appActivity: cordova.LSeCOA.Production.M…, appPackage: cordova.LSeCOA.Production, appWaitActivity: cordova.LSeCOA.Production.M…, appWaitPackage: cordova.LSeCOA.Production, databaseEnabled: false, desired: {app: D:\selenium\Workspace\eCOA…, deviceName: EDC, platformName: android}, deviceManufacturer: Google, deviceModel: Android SDK built for x86, deviceName: emulator-5554, deviceScreenSize: 1080x1920, deviceUDID: emulator-5554, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, platform: LINUX, platformName: Android, platformVersion: 8.1.0, takesScreenshot: true, warnings: {}, webStorageEnabled: false}

Session ID: 91b562da-f9aa-4cab-b6c5-9a69eeda88c6

*** Element info: {Using=id, value=serviceUrl}

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(

at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(

at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(

at org.openqa.selenium.remote.HttpCommandExecutor.execute(

at io.appium.java_client.remote.AppiumCommandExecutor.execute(

at org.openqa.selenium.remote.RemoteWebDriver.execute(

at io.appium.java_client.DefaultGenericMobileDriver.execute(

at io.appium.java_client.AppiumDriver.execute(


at org.openqa.selenium.remote.RemoteWebDriver.findElement(

at io.appium.java_client.DefaultGenericMobileDriver.findElement(

at io.appium.java_client.AppiumDriver.findElement(


at org.openqa.selenium.remote.RemoteWebDriver.findElementById(

at io.appium.java_client.DefaultGenericMobileDriver.findElementById(

at io.appium.java_client.AppiumDriver.findElementById(


at eCOA.login.main(


Keep some delay before sending the keys. Not sure is the app Open opened before sending the keys. So add some delay and then send keys.


Issue is not about delay, when i fetch the page source using ‘driver.getPageSource()’ i can see no clickable element in the page, yet there is URL text box and login page in the mobile app, and in mobile app i can enter URL and click on login button, but how to do it from appium automation ?


Please try to locate the elements from Appium Inspector. If you are able to locate elements through Appium inspector then your problem is solved.
Incase if your are unable to locate your app elements in Appium inspector, then check the app if it has a web-view or not (Might be hybrid app)?

Follow the below steps to figure out whether the app is loaded with webview or not.
This code should run after loading your app. (App should be in foreground - so that it will fetch all context names)

	    Set<String> contextSet = androidDriver.getContextHandles();
    		for(String contextName: contextSet) {
    			System.out.println("context Name " + contextName);
    			androidDriver.context(contextName); //Changing the context


Yes it is an hybrid app, i am able to locate elements in emulator by switching context, but when i connect the real andriod device i am not able to locate elements

will webview context works with real device ?


Yes Webveiw switching works on real devices too.