Device: Android
App: react native hybrid app
Appium/Appium Inspector version: Version 1.15.1 (1.15.1.20191013.2)
Issue:
I am unable to inspect a picker/dropdown. It doesn't appear in the app source at all. Hence unable to find any locators to do further automation.
Description:
I open the android app on the mobile and navigate to a form where
certain details need to be filled.One of the things to be filled is
a dropdown.
I click on the arrow on the dropdown field
A NEW window/popup appears on top of the ORIGINAL form for the
picker values to be displayed, which can be scrolled to see various
values.
This new picker value window/pop up doesnt not come in the app
source in the appium inspector at all
Can you please tell me a workaround to automate this scenario to select values in the dropdown.I am using Java + Selenium + Appium for the automation framework .
Thank you!
I hope you have used uiautomatorviewer to inspect the element on Android App. Can you please check on uiautomatorviewer if not done already.
Related
For Native Android We are using Appium with webdriverio and UIAutomator2, but when we use same of Flutter, it is not working properly. We are not able to send Keys or identify particular element.
When we use Appium Inspector on Native App side we are able to inspect each and every element on UI properly, whereas for Flutter it is combining UI element in one group as it as View
I am using Flutter Version 1.22.6
I need proper solution which will work on both Native Android and Flutter
Please help.
I also need to know this, am using Appium Inspector but the flutter elements all merge together is one big element.
I can see the big element using xpath but would like to be able to see each element separately in Appium Inspector.
I'm trying to set a date on a native android application using with Ruby + Appium + UIAutomator2.
First, Appium desktop doesn't show native datepicker on the inspection field. So, I couldn't try to swipe for the datepicker wheels.
After that I tried
send_keys()
but not a chance.
Finally, I tried the command below with "appium --relaxed-security":
driver.execute_script('mobile: shell', {'command': 'input text', 'args': '04 / 05 / 1990'})
but it didn't work neiether.
How to solve the issue? Thanks
Have you tried using UI Automator Viewer (which is part of Android SDK)?
You can connect a real device or use emulator, start the app, start UI Automator Viewer and grab a screenshot with it. You will be able to see entire screen and inspect it. This will help with creating the selectors for those nasty native elements.
Video tutorial here.
Certain pages in our android native app are not inspectable with Appium Desktop and Appium Studio. However with uiAutomatorViewer, I can inspect those screens and take resource-ids. But Appium is unable to locate element with these Ids/xpaths. Did check with dev team but they are not sure about what is going on. Does anyone had similar issues?
Any help or suggestions would appreciated much!!
Before finding element may be you can try getDriver().getPageSource() and by using this it will get the focus of the driver and then try finding elements. If this doesnt help try printing getdriver().getpagesource() in console and try to look whether the element is present in the pagesource or not. if it is there then you can use document builder and parse the pagesource text and get xpath element out of it and once you get the element (this will be generic XML element) get attributes like location and using that tap at that coordinates and this will defenitely work
I had the same problem just when dialogs where shown, To have it working I send the app to background for 0 secs, after a dialog was dismissed, and I was able to resume my tests
Python code
driver.background_app(secs) #you can specify 0 secs
Java code
driver.runAppInBackground(secs) //you can specify 0 secs
Let me know if it worked
i am learning automation testing with mobile applications.
When i had gone through some tutorials i found that we can locate elements using UIAutomator Viewer-- by taking screenshot and finding elements.
But by taking screenshot i could not find elements of some elements.
So, do we have any other ways to find elements or any other tools like UIAutomator?
Please help.
If u have any good links for mobile automation testing please do forward.
Thanks.
UIAutomator is provided by Android SDK and this is part of Android tools.
You can use the tool that provided by Appium. Please see details and example here
Generally, Install UI automator incase you are using appium in windows, if your using mac, you can identify using appium inspector.
find_element(class: "classname")
find_element(id: "resource-id name")
if you want to click on them add .click
find_element(class: "classname").click
If your still not having the details of id , text , content-desc, you can choose to add xpath
Go through this link for more info.
If you are part of testing team, testing on the app being developed, You may raise a bug to the developer in case, there are no unique identifiers and ask the dev team to add one.
When you are trying to find elements using UIautomatorviewer, you need to highlight the element which you want to find the locator.
If it's not giving you either id, name or xpath then you have to write
xpath manually. For writing xpaths manually refer these link1 and link2.
As another option, you can use appium desktop client to find the elements in the mobile app. For that you need to follow the below steps,
1. In appium window, click on 'Start Inspector Session' icon
2. In there you need to add the relevant capabilities there.
refer the image here.
desiredCapabilities.setCapability("app", "C:\\Users\\VWEERAY\\Desktop\\APPIUM\\mediashare.apk");
desiredCapabilities.setCapability("appPackage", "com.android.chrome");
desiredCapabilities.setCapability("appActivity", "org.chromium.chrome.browser.document.ChromeLauncherActivity");
desiredCapabilities.setCapability("platformName", "Android");
desiredCapabilities.setCapability("deviceName", "192.168.56.101:5555");
desiredCapabilities.setCapability("deviceName", "AndroidDevice1:5554");
desiredCapabilities.setCapability("platformVersion", "6.0");
3.Then click on 'Start Session' in the bottom.
4. It will open with a Mobile view and from there you can find locators like in the uiautomatorviewer.
We have a Cordova mobile application designed for Android platform. When we use Appium Inspector to inspect element properties we do not see either resource-id or content-desc for different elements. Could anyone please help in getting locators for these elements? Or is there anything that has to be taken care during application build time for getting any identifiers?
Attaching screenshot from Appium Inspector Window and Page Source for the page for reference.
Thanks in advance for any help!
Appium Version: 1.2.3
Java Client : 2.0.0
Page Source:
enter image description here
Finally I was able to resolve the issue, when WebView was exposed for the application. And I could inspect element properties on different screens on the mobile application.
The developers enabled this view. If anyone else is also struggling with this issue.
Please make sure you contact your developers and ask them to enable WebView for mobile application.