|Fig 2.2 Selendroid Architecture|
- Web Driver Client
- Selendroid Server
- Android driver app
- Selendroid Standalone
Web Driver Client — The Java client library based on Selenium. This library should be installed on the computer (which is used to develop the test cases).
- Interact with multiple devices
- No modification of AUT required
- Support Multiple Android target API
- Built in Inspector
- Supports Gestures.
Interact with multiple devices:
Selendroid can interact with multiple Android devices (emulators or hardware devices) at the same time. It’s a great advantage of Selendroid. So you can test your app with various android devices to check compatibility. Existing emulators are started automatically. Selendroid supports hot plugging of hardware devices. You can change the hardware devices (Plug and unplug) during the testing without restarting or stopping the test. Selendroid recognizes the new devices automatically.
No modification of app under test required in order to automate it. You can test the application under test using Selendroid without any modification of the app. You just need the binary file (APK) installed on the computer. In order to install the binary file on the device, the test app and mobile app must be signed with same sign key. not need source code to automate application.
Corresponding to the Android API version up, Selendroid also supports the new Android API (From API 10 to API 19).
Selendroid also has some built in inspector tool to help you identify the UI element of application under test. For example the ID of button, text field, text view… Selendroid comes with a useful little tool called Selendroid Inspector. It’s a little web app which is embedded inside your Selendroid test server. Its purpose is to let you inspect the current state of your app’s UI.
- View hierarchy
- View UI element properties
- UI screenshot with view locator
- Record the click actions
- Display the source html of a web view
- XPath helper
UI elements can be found by different locator types. Before interacting with elements, first the elements need to be found. Multiple Element locator strategies are supported, look at the Selendroid documentation for details.
- Get Text
- Send Keys
- Get Attribute of Element
- Is Selected
- Is Displayed
- Is Enabled
- Get Size
- Get Location
The biggest advantage of using Selendroid is the smooth switch between native and web contexts.
Gestures are supported: Advanced User Interactions API. Selendroid can simulate human-user actions on an app, such as touch, swipe, drag and drop on devices. Selendroid is implementing the Advanced User Interactions API. This is a new, more comprehensive API for describing actions a user can perform on an app. This includes actions such as drag and drop or clicking multiple elements while holding down the Control key.
- doubleTap(WebElement onElement)
- down(int x, int y)
- flick(int xSpeed, int ySpeed)
- flick(WebElement onElement, int xOffset, int yOffset, nt speed)
- longPress(WebElement onElement)
- move(int x, int y)
- singleTap(WebElement onElement)
- up(int x, int y)
For more information, you can visit their official website.