android-uiautomator

whats is the difference between UIObject and UIObject2 other than UIAutomator 2.0 version name?

和自甴很熟 提交于 2019-12-03 08:12:22
I have done some Googling and searched in Android Developer website but I could not able to find a suitable answer. Can anyone help me out for this? thanks in advance. Key Differences: What they represent Waiting for views to exist/finding views Scrolling What they represent In my words, UiObject2 is a direct representation of a real view that exists on the screen and allows you to take actions on that view. UiObject is a representation of how to find an element that may be on the screen, combined with actions that you can take on that view. UiObject as the docs say , represents the method to

Unable to find an element in Browser of the Android emulator using Appium and C#

两盒软妹~` 提交于 2019-12-02 18:15:26
问题 I want to automate mobile web site testing on Android emulator using c# and Appium. There is a simple test scenario I want to automate for the start: 1. Start Browser 2. Find an element 3. Clear it 4. Send keys I've got a problem with the second step. Every time MSTest tries to execute FindElementById line in the code below, I get the error: "An element could not be located on the page using the given search parameters." [TestClass] public class UnitTest1 { private DesiredCapabilities

Unable to find an element in Browser of the Android emulator using Appium and C#

隐身守侯 提交于 2019-12-02 07:59:24
I want to automate mobile web site testing on Android emulator using c# and Appium. There is a simple test scenario I want to automate for the start: 1. Start Browser 2. Find an element 3. Clear it 4. Send keys I've got a problem with the second step. Every time MSTest tries to execute FindElementById line in the code below, I get the error: "An element could not be located on the page using the given search parameters." [TestClass] public class UnitTest1 { private DesiredCapabilities _capabilities; private AndroidDriver _driver; public void InitializeDriver() { Console.WriteLine("Connecting

Disabling first-run greeter on fresh android emulator

心已入冬 提交于 2019-12-02 05:25:08
I am writing a test that requires launching application directly from launcher. Because I can't emulate it correctly by launching through intent. The problem is that when I am running the test on a fresh emulator (I am using Travis CI, but it can be easily reproduced on my home PC) the emulator starts with the "first run" greeter overlay. Which blocks my uiautomator code from correctly launching the application. I have tried to add some code to close that greeter but unfortunately it can appear with some delay, when my "greeter detecting and closing" code has already stopped working thinking

UIAutomator running with espresso

∥☆過路亽.° 提交于 2019-12-01 19:36:10
问题 I am currently testing an application that should be set as the default launcher. I already have a set of Espresso tests running, but they only work if the user has previously selected my app as the launcher. The dialog that appears to the user so that he can select the launcher is not reachable by Espresso , since it is outside the app itself. However, UIAutomator would be perfectly able to interact with it. Hence, I would like to know if it is possible to use some kind of UIAutomator script

UIAutomator running with espresso

跟風遠走 提交于 2019-12-01 18:28:35
I am currently testing an application that should be set as the default launcher. I already have a set of Espresso tests running, but they only work if the user has previously selected my app as the launcher. The dialog that appears to the user so that he can select the launcher is not reachable by Espresso , since it is outside the app itself. However, UIAutomator would be perfectly able to interact with it. Hence, I would like to know if it is possible to use some kind of UIAutomator script before the Espresso tests. Since UIAutomator 2.0 is now based on Android Instrumentation, you can run

The synchronization of UiAutomator

强颜欢笑 提交于 2019-12-01 07:27:53
问题 I am writing uiautomator test case for running Android app program in emulator. Here comes the problem, assume I run the Ui test case in a different emulator machine. How could I ensure the record machine and the playback machine react in the same speed. For instance, the playback machine may react slower than the record machine, So when the test case triggers a click action in a button, the playback machine may not have loaded that button in the layout. Is there any mechanism in uiautomator

How can I get the parent of a view using uiautomator?

北战南征 提交于 2019-11-30 08:27:18
I'm trying to identify the parent view of an ui element so I can navigate through the UI freely. For example, in Settings app, I can find the view with the text "Bluetooth": UiObject btView = new UiObject(new UiSelector().text("Bluetooth")); Now, the part where I get stuck is this one: I want to navigate two levels up and start a new search for the on/off button that enables and disables bluetooth. Note: I can get the button if I use the code below. UiObject btButtonView = new UiObject(new UiSelector().className("android.widget.Switch").instance(1)); This searches for switch buttons and

How to press a button twice using Google UiAutomator?

二次信任 提交于 2019-11-30 03:55:46
问题 I have the following script for typing '33' into the Calculator, in Android, using UiAutomator. However, only the first '3' is accepted, the second press is entirely ignored. import com.android.uiautomator.core.*; import com.android.uiautomator.testrunner.UiAutomatorTestCase; public class MyFirstUiAutomatorTest extends UiAutomatorTestCase { UiObject getByDescription(String description) { return new UiObject(new UiSelector().description(description)); } UiObject getByText(String description) {

Android - Independent Fragment UI testing tool

旧巷老猫 提交于 2019-11-29 21:48:27
I've been looking for a way to test the UI of my Fragments separately (ie, independently from other fragments and activities) but I can't find a way to do it. In particular, let's say I have Fragment A, Fragment B and Fragment C. The only way (app-wise) to go to Fragment C is by passing through Fragment A and Fragment B first. I am looking for a way to test Fragment C directly (potentially by mocking its dependencies, if any exists), without having to pass through Fragment A and B. Tools I investigated so far: monkey: only used to generate pseudo-random events through command line. Not what I