Unable to fetch the text from 'android.view.View' element

Hi,
I am trying to capture the text from an auto suggestive element.

Let’s say I type in ‘Euro’ in that field, it displays the matching currency with the text ‘Euro’ and I want to select one of the matching option

Note:

The class names of the options within the android.view.View.

I tried with the below code and see the count of the options, but I am getting the count as 0. Please help me with the issue.

List CcyOptions = driver.findElementsByClassName(“android.view.View”);

System.out.println(“Currencies are” +CcyOptions.size());
It is displaying 0 options.

Code and the Appium logs are copied below:

Code:

import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileElement;
import io.appium.java_client.TouchAction;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;
import io.appium.java_client.remote.MobileCapabilityType;

public class TravelexMobileTest1 {

static DesiredCapabilities cap = new DesiredCapabilities();

static TouchAction t;

public static void main(String[] args) throws InterruptedException, MalformedURLException {
// TODO Auto-generated method stub

cap = new DesiredCapabilities();
//cap.setCapability(MobileCapabilityType.DEVICE_NAME, “Nexus5API25”);
cap.setCapability(MobileCapabilityType.DEVICE_NAME, “VIBE K5 Note”);
cap.setCapability(MobileCapabilityType.PLATFORM_NAME,“Android”);
cap.setCapability(MobileCapabilityType.PLATFORM_VERSION,“6.0”);
//cap.setCapability(MobileCapabilityType.PLATFORM_VERSION,“7.1.1”);
cap.setCapability(MobileCapabilityType.BROWSER_NAME,“chrome”);
cap.setCapability(MobileCapabilityType.NO_RESET, true);
cap.setCapability(MobileCapabilityType.FULL_RESET, false);

//cap.setCapability(“appPackage”,“com.android.webview.chromium”);
//cap.setCapability(“appActivity”, “com.android.webview.chromium.LicenseActivity”);

AndroidDriver driver = new AndroidDriver<>(new URL(“http://127.0.0.1:4723/wd/hub”),cap);

driver.get(“https://www.travelex.com.au/”);
System.out.println(driver.getTitle());

//WebDriverWait wd = new WebDriverWait(driver,20);

//List CcyOptions = driver.findElementsByClassName(“android.view.View”);

//System.out.println(“Currencies are” +CcyOptions.size());
//t.tap(DestCcyCnty).perform();

//driver.findElementByAndroidUIAutomator(“new UiScrollable(new UiSelector()).scrollIntoView(text(“BUY CASH”))”);

WebElement DestCcyCnty = driver.findElement(By.name(“currency”));
DestCcyCnty.clear();
DestCcyCnty.sendKeys(“Euro”);

List CcyOptions = driver.findElementsByClassName(“android.view.View”);
System.out.println(“Currencies are” +CcyOptions.size());

//driver.findElementByClassName(“android.view.View”).click();

}

}

Appium Server Logs:
ermission.ACCESS_MOCK_LOCATION,;

[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\dabbarak\AppData\Local\Android\sdk\platform-tool
s\adb.exe’ with args: ["-P",5037,"-s",“RCSK9TUO4LVCY5FQ”,“shell”,“pm”,“grant”,“i
o.appium.settings”,“android.permission.WRITE_SETTINGS”,";",“pm”,“grant”,“io.appi
um.settings”,“android.permission.ACCESS_MOCK_LOCATION”,";"]
[debug] [AndroidDriver] Pushing unlock helper app to device…
[debug] [ADB] Running ‘C:\Users\dabbarak\AppData\Local\Android\sdk\platform-tool
s\adb.exe’ with args: ["-P",5037,"-s",“RCSK9TUO4LVCY5FQ”,“install”,“C:\Users\w
admdabbarak\AppData\Roaming\npm\node_modules\appium\node_modules\appium-u
nlock\bin\unlock_apk-debug.apk”]
[debug] [ADB] Device API level: 23
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\dabbarak\AppData\Local\Android\sdk\platform-tool
s\adb.exe’ with args: ["-P",5037,"-s",“RCSK9TUO4LVCY5FQ”,“shell”,“appops”,“set”,
“io.appium.settings”,“android:mock_location”,“allow”]
[ADB] Getting device platform version
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\dabbarak\AppData\Local\Android\sdk\platform-tool
s\adb.exe’ with args: ["-P",5037,"-s",“RCSK9TUO4LVCY5FQ”,“shell”,“getprop”,“ro.b
uild.version.release”]
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\dabbarak\AppData\Local\Android\sdk\platform-tool
s\adb.exe’ with args: ["-P",5037,"-s",“RCSK9TUO4LVCY5FQ”,“shell”,“wm”,“size”]
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\dabbarak\AppData\Local\Android\sdk\platform-tool
s\adb.exe’ with args: ["-P",5037,"-s",“RCSK9TUO4LVCY5FQ”,“shell”,“getprop”,“ro.p
roduct.model”]
[debug] [ADB] Current device property ‘ro.product.model’: Lenovo A7020a48
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\dabbarak\AppData\Local\Android\sdk\platform-tool
s\adb.exe’ with args: ["-P",5037,"-s",“RCSK9TUO4LVCY5FQ”,“shell”,“getprop”,“ro.p
roduct.manufacturer”]
[debug] [ADB] Current device property ‘ro.product.manufacturer’: LENOVO
[AndroidDriver] No app sent in, not parsing package/activity
[debug] [AndroidDriver] No app capability. Assuming it is already on the device
[debug] [AndroidBootstrap] Watching for bootstrap disconnect
[debug] [ADB] Forwarding system: 4724 to device: 4724
[debug] [ADB] Running ‘C:\Users\dabbarak\AppData\Local\Android\sdk\platform-tool
s\adb.exe’ with args: ["-P",5037,"-s",“RCSK9TUO4LVCY5FQ”,“forward”,“tcp:4724”,“t
cp:4724”]
[debug] [UiAutomator] Starting UiAutomator
[debug] [UiAutomator] Moving to state ‘starting’
[debug] [UiAutomator] Parsing uiautomator jar
[debug] [UiAutomator] Found jar name: ‘AppiumBootstrap.jar’
[debug] [ADB] Running ‘C:\Users\dabbarak\AppData\Local\Android\sdk\platform-tool
s\adb.exe’ with args: ["-P",5037,"-s",“RCSK9TUO4LVCY5FQ”,“push”,“C:\Users\wadm
dabbarak\AppData\Roaming\npm\node_modules\appium\node_modules\appium-andr
oid-bootstrap\bootstrap\bin\AppiumBootstrap.jar”,"/data/local/tmp/"]
[debug] [ADB] Attempting to kill all uiautomator processes
[debug] [ADB] Getting all processes with uiautomator
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\dabbarak\AppData\Local\Android\sdk\platform-tool
s\adb.exe’ with args: ["-P",5037,"-s",“RCSK9TUO4LVCY5FQ”,“shell”,“ps”]
[ADB] No uiautomator process found to kill, continuing…
[debug] [UiAutomator] Starting UIAutomator
[debug] [ADB] Creating ADB subprocess with args: ["-P",5037,"-s",“RCSK9TUO4LVCY5
FQ”,“shell”,“uiautomator”,“runtest”,“AppiumBootstrap.jar”,"-c",“io.appium.androi
d.bootstrap.Bootstrap”,"-e",“pkg”,“com.android.chrome”,"-e",“disableAndroidWatch
ers”,false,"-e",“acceptSslCerts”,false]
[debug] [UiAutomator] Moving to state ‘online’
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] json loading complete.
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Registered crash watchers.
[AndroidBootstrap] Android bootstrap socket is now connected
[debug] [ADB] Getting connected devices…
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Client connected
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\dabbarak\AppData\Local\Android\sdk\platform-tool
s\adb.exe’ with args: ["-P",5037,"-s",“RCSK9TUO4LVCY5FQ”,“shell”,“dumpsys”,“wind
ow”]
[AndroidDriver] Screen already unlocked, doing nothing
[AndroidDriver] Starting a chrome-based browser session
[debug] [AndroidDriver] A port was not given, using random port: 8000
[debug] [Chromedriver] Changed state to ‘starting’
[Chromedriver] Set chromedriver binary as: C:\Users\wadmdabbarak\AppData\Roaming
\npm\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win\chrom
edriver.exe
[Chromedriver] Killing any old chromedrivers, running: FOR /F “usebackq tokens=5
" %a in (netstat -nao ^| findstr /R /C:"8000 ") do (FOR /F “usebackq” %b in (TASKLIST /FI "PID eq %a" ^| findstr /I chromedriver.exe) do (IF NOT %b==”" TASK
KILL /F /PID %a))
[Chromedriver] No old chromedrivers seemed to exist
[Chromedriver] Spawning chromedriver with: C:\Users\wadmdabbarak\AppData\Roaming
\npm\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win\chrom
edriver.exe --url-base=wd/hub --port=8000 --adb-port=5037
[Chromedriver] [STDOUT] Starting ChromeDriver 2.28.455520 (cc17746adff54984afff4
80136733114c6b3704b) on port 8000
Only local connections are allowed.
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8000/wd/h
ub/status] with no body
[debug] [JSONWP Proxy] Got response with status 200: “{“sessionId”:”",“stat
us”:0,“value”:{“build”:{“version”:“alpha”},“os”:{“arch”:“x86_64”,
“name”:“Windows NT”,“version”:“6.3.9600”}}}"
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/w
d/hub/session] with body: {“desiredCapabilities”:{“chromeOptions”:{“androidPacka
ge”:“com.android.chrome”,“androidDeviceSerial”:“RCSK9TUO4LVCY5FQ”}}}
[debug] [JSONWP Proxy] Got response with status 200: {“sessionId”:“e2eb714734818
5b32b1aa667795b89ef”,“status”:0,“value”:{“acceptSslCerts”:true,“applicationCache
Enabled”:false,“browserConnectionEnabled”:false,“browserName”:“chrome”,“chrome”:
{“chromedriverVersion”:“2.28.455520 (cc17746adff54984afff480136733114c6b3704b)”}
,“cssSelectorsEnabled”:true,“databaseEnabled”:false,“handlesAlerts”:true,“hasTou
chScreen”:true,“javascriptEnabled”:true,“locationContextEnabled”:true,“mobileEmu
lationEnabled”:false,“nativeEvents”:true,“pageLoadStrategy”:“normal”,“platform”:
“ANDROID”,“rotatable”:false,“takesHeapSnapshot”:true,“takesScreenshot”:true,“une
xpectedAlertBehaviour”:"",“version”:“59.0.3071.125”,“webStorageEnabled”:true}}
[debug] [Chromedriver] Changed state to ‘online’
[Appium] New AndroidDriver session created successfully, session 25fd20bf-fb91-4
307-aa7e-40706f35ea08 added to master session list
[debug] [BaseDriver] Event ‘newSessionStarted’ logged at 1501832848904 (17:47:28
GMT+1000 (AUS Eastern Standard Time))
[debug] [MJSONWP] Responding to client with driver.createSession() result: {“pla
tform”:“LINUX”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabl
ed”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContex
tEnabled”:false,“warnings”:{},“desired”:{“noReset”:true,“platformVersion”:“6.0”,
“browserName”:“chrome”,“platformName”:“Android”,“deviceName”:“VIBE K5 Note”,“ful
lReset”:false},“noReset”:true,“platformVersion”:“6.0”,“browserName”:“chrome”,“pl
atformName”:“Android”,“deviceName”:“RCSK9TUO4LVCY5FQ”,“fullReset”:false,“deviceU
DID”:“RCSK9TUO4LVCY5FQ”,“deviceScreenSize”:“1080x1920”,“deviceModel”:“Lenovo A70
20a48”,“deviceManufacturer”:“LENOVO”}
[HTTP] <-- POST /wd/hub/session 200 24578 ms - 674
[HTTP] --> GET /wd/hub/session/25fd20bf-fb91-4307-aa7e-40706f35ea08 {}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [JSONWP Proxy] Proxying [GET /wd/hub/session/25fd20bf-fb91-4307-aa7e-407
06f35ea08] to [GET http://127.0.0.1:8000/wd/hub/session/e2eb7147348185b32b1aa667
795b89ef] with body: {}
[debug] [JSONWP Proxy] Got response with status 200: “{“sessionId”:“e2eb71473
48185b32b1aa667795b89ef”,“status”:0,“value”:{“acceptSslCerts”:true,“appl
icationCacheEnabled”:false,“browserConnectionEnabled”:false,“browserName”:
“chrome”,“chrome”:{“chromedriverVersion”:“2.28.455520 (cc17746adff54984aff
f480136733114c6b3704b)”},“cssSelectorsEnabled”:true,“databaseEnabled”:false
,“handlesAlerts”:true,“hasTouchScreen”:true,“javascriptEnabled”:true,“loc
ationContextEnabled”:true,“mobileEmulationEnabled”:false,“nativeEvents”:tru
e,“pageLoadStrategy”:“normal”,“platform”:“ANDROID”,“rotatable”:false,
“takesHeapSnapshot”:true,“takesScreenshot”:true,“unexpectedAlertBehaviour”:
“”,“version”:“59.0.3071.125”,“webStorageEnabled”:true}}”
[JSONWP Proxy] Replacing sessionId e2eb7147348185b32b1aa667795b89ef with 25fd20b
f-fb91-4307-aa7e-40706f35ea08
[HTTP] <-- GET /wd/hub/session/25fd20bf-fb91-4307-aa7e-40706f35ea08 200 26 ms -
669
[HTTP] --> GET /wd/hub/session/25fd20bf-fb91-4307-aa7e-40706f35ea08 {}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [JSONWP Proxy] Proxying [GET /wd/hub/session/25fd20bf-fb91-4307-aa7e-407
06f35ea08] to [GET http://127.0.0.1:8000/wd/hub/session/e2eb7147348185b32b1aa667
795b89ef] with body: {}
[debug] [JSONWP Proxy] Got response with status 200: “{“sessionId”:“e2eb71473
48185b32b1aa667795b89ef”,“status”:0,“value”:{“acceptSslCerts”:true,“appl
icationCacheEnabled”:false,“browserConnectionEnabled”:false,“browserName”:
“chrome”,“chrome”:{“chromedriverVersion”:“2.28.455520 (cc17746adff54984aff
f480136733114c6b3704b)”},“cssSelectorsEnabled”:true,“databaseEnabled”:false
,“handlesAlerts”:true,“hasTouchScreen”:true,“javascriptEnabled”:true,“loc
ationContextEnabled”:true,“mobileEmulationEnabled”:false,“nativeEvents”:tru
e,“pageLoadStrategy”:“normal”,“platform”:“ANDROID”,“rotatable”:false,
“takesHeapSnapshot”:true,“takesScreenshot”:true,“unexpectedAlertBehaviour”:
“”,“version”:“59.0.3071.125”,“webStorageEnabled”:true}}”
[JSONWP Proxy] Replacing sessionId e2eb7147348185b32b1aa667795b89ef with 25fd20b
f-fb91-4307-aa7e-40706f35ea08
[HTTP] <-- GET /wd/hub/session/25fd20bf-fb91-4307-aa7e-40706f35ea08 200 22 ms -
669
[HTTP] --> POST /wd/hub/session/25fd20bf-fb91-4307-aa7e-40706f35ea08/url {“url”:
https://www.travelex.com.au/”}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [JSONWP Proxy] Proxying [POST /wd/hub/session/25fd20bf-fb91-4307-aa7e-40
706f35ea08/url] to [POST http://127.0.0.1:8000/wd/hub/session/e2eb7147348185b32b
1aa667795b89ef/url] with body: {“url”:“https://www.travelex.com.au/”}
[debug] [JSONWP Proxy] Got response with status 200: {“sessionId”:“e2eb714734818
5b32b1aa667795b89ef”,“status”:0,“value”:null}
[JSONWP Proxy] Replacing sessionId e2eb7147348185b32b1aa667795b89ef with 25fd20b
f-fb91-4307-aa7e-40706f35ea08
[HTTP] <-- POST /wd/hub/session/25fd20bf-fb91-4307-aa7e-40706f35ea08/url 200 240
61 ms - 76
[HTTP] --> GET /wd/hub/session/25fd20bf-fb91-4307-aa7e-40706f35ea08/title {}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [JSONWP Proxy] Proxying [GET /wd/hub/session/25fd20bf-fb91-4307-aa7e-407
06f35ea08/title] to [GET http://127.0.0.1:8000/wd/hub/session/e2eb7147348185b32b
1aa667795b89ef/title] with body: {}
[debug] [JSONWP Proxy] Got response with status 200: “{“sessionId”:“e2eb71473
48185b32b1aa667795b89ef”,“status”:0,“value”:“Currency Exchange & Travel Mo
ney at Great Rates | Travelex”}”
[JSONWP Proxy] Replacing sessionId e2eb7147348185b32b1aa667795b89ef with 25fd20b
f-fb91-4307-aa7e-40706f35ea08
[HTTP] <-- GET /wd/hub/session/25fd20bf-fb91-4307-aa7e-40706f35ea08/title 200 15
3 ms - 132
[HTTP] --> POST /wd/hub/session/25fd20bf-fb91-4307-aa7e-40706f35ea08/element {“u
sing”:“name”,“value”:“currency”}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [JSONWP Proxy] Proxying [POST /wd/hub/session/25fd20bf-fb91-4307-aa7e-40
706f35ea08/element] to [POST http://127.0.0.1:8000/wd/hub/session/e2eb7147348185
b32b1aa667795b89ef/element] with body: {“using”:“name”,“value”:“currency”}
[debug] [JSONWP Proxy] Got response with status 200: {“sessionId”:“e2eb714734818
5b32b1aa667795b89ef”,“status”:0,“value”:{“ELEMENT”:“0.7438502268891607-1”}}
[JSONWP Proxy] Replacing sessionId e2eb7147348185b32b1aa667795b89ef with 25fd20b
f-fb91-4307-aa7e-40706f35ea08
[HTTP] <-- POST /wd/hub/session/25fd20bf-fb91-4307-aa7e-40706f35ea08/element 200
160 ms - 106
[HTTP] --> POST /wd/hub/session/25fd20bf-fb91-4307-aa7e-40706f35ea08/element/0.7
438502268891607-1/clear {“id”:“0.7438502268891607-1”}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [JSONWP Proxy] Proxying [POST /wd/hub/session/25fd20bf-fb91-4307-aa7e-40
706f35ea08/element/0.7438502268891607-1/clear] to [POST http://127.0.0.1:8000/wd
/hub/session/e2eb7147348185b32b1aa667795b89ef/element/0.7438502268891607-1/clear
] with body: {“id”:“0.7438502268891607-1”}
[debug] [JSONWP Proxy] Got response with status 200: {“sessionId”:“e2eb714734818
5b32b1aa667795b89ef”,“status”:0,“value”:null}
[JSONWP Proxy] Replacing sessionId e2eb7147348185b32b1aa667795b89ef with 25fd20b
f-fb91-4307-aa7e-40706f35ea08
[HTTP] <-- POST /wd/hub/session/25fd20bf-fb91-4307-aa7e-40706f35ea08/element/0.7
438502268891607-1/clear 200 989 ms - 76
[HTTP] --> POST /wd/hub/session/25fd20bf-fb91-4307-aa7e-40706f35ea08/element/0.7
438502268891607-1/value {“id”:“0.7438502268891607-1”,“value”:[“Euro”]}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [JSONWP Proxy] Proxying [POST /wd/hub/session/25fd20bf-fb91-4307-aa7e-40
706f35ea08/element/0.7438502268891607-1/value] to [POST http://127.0.0.1:8000/wd
/hub/session/e2eb7147348185b32b1aa667795b89ef/element/0.7438502268891607-1/value
] with body: {“id”:“0.7438502268891607-1”,“value”:[“Euro”]}
[debug] [JSONWP Proxy] Got response with status 200: {“sessionId”:“e2eb714734818
5b32b1aa667795b89ef”,“status”:0,“value”:null}
[JSONWP Proxy] Replacing sessionId e2eb7147348185b32b1aa667795b89ef with 25fd20b
f-fb91-4307-aa7e-40706f35ea08
[HTTP] <-- POST /wd/hub/session/25fd20bf-fb91-4307-aa7e-40706f35ea08/element/0.7
438502268891607-1/value 200 4210 ms - 76
[HTTP] --> POST /wd/hub/session/25fd20bf-fb91-4307-aa7e-40706f35ea08/elements {"
using":“class name”,“value”:“android.view.View”}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [JSONWP Proxy] Proxying [POST /wd/hub/session/25fd20bf-fb91-4307-aa7e-40
706f35ea08/elements] to [POST http://127.0.0.1:8000/wd/hub/session/e2eb714734818
5b32b1aa667795b89ef/elements] with body: {“using”:“class name”,“value”:“android.
view.View”}
[debug] [JSONWP Proxy] Got response with status 200: {“sessionId”:“e2eb714734818
5b32b1aa667795b89ef”,“status”:0,“value”:[]}
[JSONWP Proxy] Replacing sessionId e2eb7147348185b32b1aa667795b89ef with 25fd20b
f-fb91-4307-aa7e-40706f35ea08
[HTTP] <-- POST /wd/hub/session/25fd20bf-fb91-4307-aa7e-40706f35ea08/elements 20
0 245 ms - 74
[BaseDriver] Shutting down because we waited 60 seconds for a command
[debug] [AndroidDriver] Shutting down Android driver
[Appium] Closing session, cause was ‘New Command Timeout of 60 seconds expired.
Try customizing the timeout using the ‘newCommandTimeout’ desired capability’
[Appium] Removing session 25fd20bf-fb91-4307-aa7e-40706f35ea08 from our master s
ession list
[debug] [AndroidDriver] Stopping chromedriver for context CHROMIUM
[debug] [Chromedriver] Changed state to ‘stopping’
[debug] [JSONWP Proxy] Proxying [DELETE /] to [DELETE http://127.0.0.1:8000/wd/h
ub/session/e2eb7147348185b32b1aa667795b89ef] with no body
[debug] [JSONWP Proxy] Got response with status 200: “{“sessionId”:“e2eb71473
48185b32b1aa667795b89ef”,“status”:0,“value”:null}”
[debug] [Chromedriver] Changed state to ‘stopped’
[debug] [ADB] Pressing the HOME button
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\dabbarak\AppData\Local\Android\sdk\platform-tool
s\adb.exe’ with args: ["-P",5037,"-s",“RCSK9TUO4LVCY5FQ”,“shell”,“input”,“keyeve
nt”,3]
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“shutdown”}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“shutdow
n”}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type SHUTDOWN
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [UiAutomator] Shutting down UiAutomator
[debug] [UiAutomator] Moving to state ‘stopping’
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”
:“OK, shutting down”}
[debug] [AndroidBootstrap] [UIAUTO STDOUT] close [socket][/127.0.0.1:4724]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Closed client connection
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: numtests=1
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: stream=.
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: id=UiAutomato
rTestRunner
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: test=testRunS
erver
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: class=io.appi
um.android.bootstrap.Bootstrap
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: current=1
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS_CODE: 0
[debug] [UiAutomator] UiAutomator shut down normally
[debug] [UiAutomator] Moving to state ‘stopped’
[debug] [ADB] Attempting to kill all uiautomator processes
[debug] [ADB] Getting all processes with uiautomator
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\dabbarak\AppData\Local\Android\sdk\platform-tool
s\adb.exe’ with args: ["-P",5037,"-s",“RCSK9TUO4LVCY5FQ”,“shell”,“ps”]
[ADB] No uiautomator process found to kill, continuing…
[debug] [UiAutomator] Moving to state ‘stopped’
[debug] [Logcat] Stopping logcat capture
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\dabbarak\AppData\Local\Android\sdk\platform-tool
s\adb.exe’ with args: ["-P",5037,"-s",“RCSK9TUO4LVCY5FQ”,“shell”,“am”,“force-sto
p”,“io.appium.unlock”]
[debug] [AndroidDriver] Not cleaning generated files. Add clearSystemFiles cap
ability if wanted.
[Appium] Received SIGINT - shutting down

you are in Chrome view. Imaging you are automating not mobile but Chrome on PC/MAC. UIAutomator does not shot this (unfortunately). To understand it deeper to see how it is look like do:

  1. open this page in test code
  2. print into console:
    System.out.println(driver.getPageSource())

now check what inside.

1 Like

Hi Aleksei,

Thank you so much for the suggestion to look through page source.

elements are able to be identified by class name “ui-menu-item”. I now observe that the class name is same for the desktop browser elements also for this.

Thank you so much.

Thanks so much!!! You saved my day!!!