Print

Using Selendroid Inspect Mobile App Element Locator and Testing

When testing native mobile apps on mobile simulator/emulator/ device,identifying the element locator is very important. We can use Selendroid Inspectors to view element definition and its hierarchy.

Selendroid Inspector is a ittle web app that is embedded inside your selendroid test server. It allows you to inspect the current state of your mobile app’s UI.

Selendroid Inspector has features:
(1) View hierarchy
(2) View UI element properties
(3) UI screenshot with view locator
(4) Record the click actions
(5)Display the source html of a web view
(6) XPath helper

In this article, you will learn how to use the Selendroid Inspector to view a mobile app elements and run the test. You can find the tutorial on this site location (http://selendroid.io/inspector.html).

Important: Selenium mobile app test requires that android-sdk must be installed and configured properly on your computer, so you need to make sure that android-sdk environment was setup on your computer in advance. If you need help, please visit the site http://selendroid.io/setup.html.

Step 1: download Selendroid jar file and test mobile app.

Print

Use Selendroid to Test Mobile Web Application on Mobile Device

To assure the quality of mobile web application, we need to test mobile web application on real mobile devices instead of testing it on mobile emulator. This example teaches you how to test mobile web application on android mobile device. 

In this article, we use Ebay mobile site as a test application.  To identify web elements, please read the article titled "How to Identify Mobile Web Application Elements for Selendroid" . 

Test Case

Verify that users are able to search merchandise on Ebay mobile web site.

Test Step

Step 1: navigate to http://m.ebay.com

Step 2: type in android in the search box

Step 3: click on search button or press enter.

Step 4: assert that the website returns number of android merchandises.

Automation Test Implementation

Step 1: create a Java project named "SeleniumMasterMobileTest", add a package named "com.seleniummaster.mobiletest", and add a JUnit test class named "MobileWebTesteBayMobile.java". Make sure that in the build path, you referenced all required libraries as well as the Selendroid web driver library "selendroid-standalone-0.9.0-SNAPSHOT-with-dependencies.jar". 

Print

How to Identify Mobile Web Application Elements for Selendroid

When using Selendroid to test mobile web application on mobile devices or mobile simulators, identifying web elements are very important. Without correct element identification, Selendroid mobile web driver cannot find elements in the test automation application. This article shows you how to use Safari User Agent to view mobile web application and identify web elements by using web elements inspector.

Test Case: verify that users are able to search merchandise on Ebay mobile web site.

Step 1: navigate to http://m.ebay.com

Step 2: type in android in the search box

Step 3: click on search button or press enter.

Step 4: assert that the website returns  number of android merchandises. 

Element Identification

1. Open Safari browser and type in "http://m.ebay.com". Since there is no User Agent defined on Safari Browser, this site navigates to desktop version of Ebay site. 

Print

Use Selenium Appium Automation For Mobile Apps

In this example, I will explain how to use Selenium Appium Automation for mobile app testing. 

Appium is an open source test automation framework for use with native and hybrid mobile apps. It drives iOS and Android apps using the WebDriver JSON wire protocol. 

Step 1: download the Appium Framework and sample example files provided by the site http://appium.io .  Click on the corresponding links to download the framework and sample files. 

Print

Using Selendroid For Mobile Web Test Automation

Selendroid is a test automation framework which drives off the UI of Android native and hybrid applications (apps) and the mobile web. Tests are written using the Selenium 2 client AP. In this example, you will learn how to use Selendroid for testing a mobile web application. Test site for this example is the Mahara ePortfolio demo site "http://demo.mahara.org".

Test case:

Admin user should be able to log on to the system.

Test Implementation

Step 1: Download the Selendroid Standalone Java libraries from this site "http://selendroid.io/". If latest build is available on this location, download the latest snapshot from here "http://ci.selendroid.io/job/selendroid/io.selendroid%24selendroid-standalone/".

Step 2: Install Android SDK from the android development site "http://developer.android.com/sdk/index.html" . And setup the android development environment according to the instruction on this site "http://spring.io/guides/gs/android/".