Appium Android-Taking more than 2 minutes to find/click on a mobile element on a real device - appium

I'm new to Appium and was designing a simple testcase to find an element and to click on a mobile element. I used real devices(Android) instead of emulators. It took about 2 mins or more to find the element and click on the element. As choosing Xpath to find elements in Android is a slower strategy, I used Accessibility Id but couldn't find any difference in the performance.
newstart_ele=driver.find_element(by=AppiumBy.ACCESSIBILITY_ID,value="NewstartButton")
newstart_ele.click()
Appium Python Client-> v2.7.1

Lowering waitForIdleTimeOut might help. See here.

Related

Check if element is focused in Appium

How do I check if an element is focused in Appium? The advice for selenium seems to be to use:
element.equals(driver.switchTo().activeElement());
However this does not work using the appium mac2 driver as it appears that it's not possible to compare two elements for equality in appium:
https://github.com/appium/appium/issues/2404
https://github.com/appium/appium/issues/9962

How to view saved page source in Appium app

While running automated test using appium I used driver.getPageSource() and stored it as a XML file. I also took the screenshot of the same page using driver.takeScreenshot() and saved it as a PNG file. Now how do I view it in Appium app so that it correspondingly maps to the elements with the xml data.
Is there a open option in Appium like in uiautomatorviewer?
I couldn't use uiautomator because it requires uix file. But I couldn't find open option in appium.
UIAutomatorviewer is simple tool to start with mobile automation , however it has some limitations
Less robust:
Throws random errors while working with native apps
Limited functionality:
Limited features as compared to APPIUM Desktop
These limitations do not allow UIAUTOMATORVIEWER to be a universal choice among the automation engineers , and mostly it’s used along with Appium Desktop.
For Installation and Usage you can refer below URL
https://automationlab0000.wordpress.com/2018/12/31/appium-desktop-for-locating-elements/
Due to the complex setup of Appium, it is quite difficult to be dependant only on Appium for mobile automation.
With Appium Studio of SeeTest you can easily identify objects.
Appium Studio mitigates all of Appium's challenges with ease. There is also an object spy for easier object and XPath identification. Tests are recorded simply. Actions carried out on the device reflection are recorded in an easily exported and executable test written in the language of your choice.
Visit this blog for more details.
Refer their docs to get started https://docs.experitest.com/display/public/TD/Appium+Studio

How to take UI Automator dump for dynamic screens

We are trying to automate an android screen in which there is a progress bar which gets updated every second. Our framework retrieves the UI dump using adb shell uiautomator dump to get the UI heirarchy layout and then parses the xml to take further actions. We observed that for the above mentioned screen we are not able to get the dump and the above command reports an error "Could not get idle state".
On the same screen, we tried with appium and appium is able to retrieve the elements on UI. How is appium able to retrieve the information, which UI Automator is not able to retrieve.? We would not want to integrate appium as a tool at this point in our framework and would like to use ui automator dump itself. Is there a way to overcome this issue?
The thing is that Appium has 2 drivers for Android: AndroidDriver and UIAutomator2Driver (for Android 5+)
The 2nd one is a custom client-server implementation of UIAutomator:
https://github.com/appium/appium-uiautomator2-server
https://github.com/appium/appium-uiautomator2-driver
So it literally means "Appium don't use UIAutomator as is" any longer.
Google is no longer supporting UIAutomator (last release was july 2017) in favour of Espresso.
Check code of server part and you will understand that with UIAutomator2 Appium overrides lots of original UIAutomator stuff to solve issues like you described and many more.
If you don't want to use Appium, you still can reuse UIAutomator2 Server or at least write your custom framework on its basis and solve issues of original UiAutomator.

Infragistics WebDatePicker: calendar dropdown broken in iOS

We're making a big web form for customers, and it's got half a dozen date fields, for which we are using the Infragistics WebDatePicker control (in asp.net 4.6). They work fine (though applying validators to them was a lot of work) except when we try them on an iPad. In Safari for iOS, tapping on the button to drop down the calendar causes it to flash momentarily and then disappear. No such problem on an android device, so far as we've seen. The problem isn't just on our new page, but on all our old ones that also use the control.
Edit: the problem happens in Safari but not in Chrome.
Has anybody encountered this? Has any work been put into resolving this issue? Or are we the only ones seeing it?
Googling seems to come up empty, and Infragistics' support request page appears to currently be inaccessible.
I'm hoping this doesn't come down to finding a way to instrument 50 javascript events on an ipad.
To update, here is the exact case where we're seeing the problem:
device: iPad Air 2 64gb (model MH2M2LL/A)
system: iOS 8.4.1
browser: Mobile Safari 600.1.4
infragistics version: 15.2 for asp.net 4.5
example site: http://www.infragistics.com/products/aspnet/editors/date-picker
...yup, it's failing in Infragistics' own demo page. (Use the second "view sample" link.)
It doesn't fail every time: sometimes the first click after page load succeeds, but the ones after it all fail.
Second update: Infragistics has entered this in their bug tracker as #216122.
I have tested this with the latest SR for 15.1 and could not reproduce the described issue. In order to receive better support, I suggest you to open a ticket for this issue trough the Infragistics site. What is more, it will be best if you add all the related environment details (like Infragistics product version you are using), and attach a simple code sample in order for the Infragistics Dev Support to reproduce the described behavior.

Writing tests in Appium for ActionScript-based iPad app

I downloaded and set up Appium to run tests for an app developed in ActionScript for the iPad. I can run Appium just fine, however am having trouble actually writing tests. The problem is that I don't have any way to retrieve elements from the app. I thought I could do this with the selenium driver (I am currently creating an IOSDriver with Appium), however can't seem to figure out exactly how. All of the elements created by my application are flash-based (TextField for example), so I'm not sure how to retrieve them with the normal findElement method(s).
(Note I cannot update the code to comply with my tests, it must be the tests that comply with the pre-written code)
The Accessibility-based mechanism underlying the UI Automation feature represents every control in your app as a uniquely identifiable element. To perform an action on an element in your app, you explicitly identify that element in terms of the app’s element hierarchy.
This link is useful Tutorial
Tools You may like to try Although they are not exactly like UiAutomatorViewer which is for android
Reveal App
SparkInspector
Ios Hierarchy-Viewer
As far as Flas Elements concers Lets Look at this tutorial.

Resources