Skip to content

Iptv Assist

Learn More from us

Menu
  • HOW TO
  • Firestick
  • Chromecast
  • PC Apps
  • Lg Smart TV
  • IPTV Services
  • Automation Testing
  • Smart TV
  • Software Testing Tools
  • Contact Us
Menu

Selendroid Tutorial: Android Mobile Test Automation Framework (Part 1)

Posted on January 22, 2023

Best Iptv Service Provider 2023 With 40k+ Channels And 100k+ VOD . 24/7 Suppport . Paypal Supported

Mobile Automation using Selendroid (Part-I):

Best Iptv Service Provider 2023 With 40k+ Channels And 150k+ VOD . Hurry Up

Until now, millions of apps are already been developed using Android as a platform and the count still keeps on increasing day by day.

Recommended IPTV Service Providers

  1. IPTVGREAT – Rating 4.8/5 ( 600+ Reviews )
  2. IPTVRESALE – Rating 5/5 ( 200+ Reviews )
  3. IPTVGANG – Rating 4.7/5 ( 1200+ Reviews )
  4. IPTVUNLOCK – Rating 5/5 ( 65 Reviews )
  5. IPTVFOLLOW -Rating 5/5 ( 48 Reviews )
  6. IPTVTOPS – Rating 5/5 ( 43 Reviews )

 

The catch is, how to validate each and every app? As we will be requiring dedicated resources such as manpower, real devices (say e.g. mobile) etc., and again it is a time-consuming task. On the other hand,  android version, applications (.apk) version, device dimension etc., are not constant. 

Hence, it becomes very difficult to define test exit criteria as we cannot define the complete testing scope, thereby exact testing effort estimation cannot be done.

Selendroid Test Framework Tool

In order to overcome the device dependency, emulators are being developed, which can provide real-time like environment, where we can test the application without worrying about the android version, devices, and their version. But, still testing of applications (.apk) over emulator is a manual activity and a time-consuming task even. Hence the idea of automating mobile testing is being evolved.

To perform mobile automation, test automation framework is developed, which enables automation of Android-based application by using a scripting language.

There are many automation frameworks developed such as Selendroid, Appium, Robotium, Espresso.

This tutorial is divided into two parts:

Tutorial #1: Selendroid Introduction: Android Mobile Test Automation Framework
Tutorial #2: How to use Selendroid framework to automate the user interactions over a mobile application (coming soon)

What You Will Learn:

  • What is Selendroid?
    • Why Selendroid?
    • A simple Architecture of Selendroid
  • Selendroid Components
    • Selendroid – Client
    • Selendroid – Standalone
    • Selendroid – Server
    • AndroidDriverApp
  • Environmental Setup
  • Writing First Script Using APK Files Over Real Devices
  • Conclusion

What is Selendroid?

Selendroid is an amazing Android mobile application test automation framework tool with several important features. Selendroid is a very powerful automation tool which can interact with multiple devices simultaneously and an application can be tested without any modification or change using Selendroid.

It is also called “Selenium for Android” for testing native and hybrid mobile apps and mobile web.

Why Selendroid?

  • It is an open source (free to use)
  • Supports Selenium as a scripting language
  • Supports web driver compatible languages such as Java, C#, Perl
  • Supports all Android Versions
  • Works both on an emulator as well as the real device
  • Works on a native, hybrid and web-based application
  • Effective while executing native applications as well cloud-based application. as it supports selenium grid
  • It supports object recognition using object properties
  • Easy to implement
  • Hardware devices can be Plugged, unplugged from the PC during test execution, without restarting or stopping the test. Selendroid can recognize the new devices automatically. This feature is known as “Hotplugging”

A simple Architecture of Selendroid

Architecture of Selendroid

Selendroid Components

Selendroid – Client

Basically, it is a java client library. From this component, The HTTP & WebDriver request are being sent using JSON to the Selendroid Standalone server.

Selendroid – Standalone

This component manages different devices as well as the .apk’s by installing the Selendroid-server and the app under test. The Http request (to be executed over real device/simulator) are being sent from Selendroid standalone server to the device and the apk under test.

Selendroid – Server

This server runs over the device along with the application under test. There is a two-way communication between the server as well as the application under test.

AndroidDriverApp

It is a built-in Android driver as well as a Web View app to test the mobile web.

Another test framework named as APPIUM works similar to a Selendroid.

Here is a small comparison between the both.

Feature Selendroid Appium
Support for Lower android version(<4.1) Yes No
Hot plugging Yes No
User Agent Testing No Yes
Support for iOS based application No Yes
Environmental Requirement For Android – Mac, Linux, Windows(any version) For iOS – Mac OSX 107.
For Android – Windows 7+, Linux, Mac OSX 107.

Pre-requisites:

To start with the Intended audience should be very well aware of using selenium, any IDE tools such as Eclipse etc. Basic concepts of programming say Java, C etc…  and must be aware of using Maven and other TESTING tools.

  • Install Intel x86 Emulator Accelerator (not mandatory) to view the simulator from here
  • Java SDK, JRE already installed in a test environment. Alternately you can download the same from here

Note down the SDK Path while installing.

Set the environmental variables present over My Computer -> rightclick it -> Properties -> Advance System Setting

Android Path

Java Home

  • Eclipse is already installed on your machine. If not, you can also download the same from here
  • Selenium jar files are to be downloaded. You can download the same from here as well
  • TestNG jars are already downloaded
  • Android SDK to be downloaded and installed. You can also download the same from here

Note down Android SDK Path while installing

Once downloaded the ANDROID_HOME should be set in the environmental variables present over:

My Computer -> right click it -> Properties -> Advance System Setting

Android Path

  • Selendroid jar files are to be downloaded. You can also download the same from here

Remember to download the Selendroid standalone jar file from the above location. Usually, the name is like selendroid-standalone-0.9.0-with-dependencies.jar. Also, download one sample APK file say selendroid-test-app-0.8.0.apk from the above location

Note: 

  • We can also use maven repository  to give the reference to all the jars or else you have to download them manually and attach it to the build path (Over Eclipse Project)
  • Devices/Emulators – In android all the installed application will have the .apk extension. In other ways you can download apps such as APK Info which will inform you about the list of applications installed on your android device and its actual name, size etc…

Environmental Setup

#1) Keep the APK which needs to be installed over a proper location

In my case I kept it over G:\Jars\selendroid-test-app-0.8.0.apk

#2) Next, keep the application over the project folder

In my case it is D:AppiumAutomationSelendroidFirst

Local APK

#3) Connect the real device to the PC

Making sure the USB Debugging mode is enabled and also you are allowing external apps to get installed through USB connection.

Tips:

  • Please refer the USB debugging setting required for mobile say Redmi Note 3 from here
  • Allow external application installed using USB say Redmi note 3 from here

#4) Open the command prompt over Windows

Navigate to the folder where Selendroid standalone jar, as well as the downloaded apk file, are present.

Now specify the similar command and press enter in the command prompt

E.g. java –jar selendroid-standalone-0.15.0-with-dependencies.jar -aut selendroid-test-app-0.8.0.apk

Or java –jar selendroid-standalone-0.15.0-with-dependencies.jar

APK File: selendroid-test-app-0.8.0.apk

Note: When the above command is executed, make sure that the APK is signed and also the real device is connected to the PC and debugging is enabled over the device.

(Note: Click on the image for an enlarged view)

Command Console

Check the following points over command prompt to make sure the environment is ready for automation:

  • Verify for message “Device Specified with valid number”
  • Verify for message “server is started in default port say (4444)…”
  • Verify for message “Session being created…”

Again we can always reconfirm whether a server is started or not using the following URL over any of your web browsers.

e.g. http://localhost:4444/wd/hub/status

Confirmation of Server

#5) Inspecting the APK’s

  • We can use Real Apps by connecting real mobile devices
  • We can use any offline APK files downloaded

Selendroid Inspector is useful in debugging/inspecting the web elements of APK.

Once the device is identified and started we can view the APK (in virtual mode) and find the references, which is useful for writing the scripts, using the following URL over any of your web browsers.

E.g: http://localhost:4444/inspector

Here we have the screenshot of the application under test and we have the facility to inspect the element as well.

Or you can always use uiautomatorviewer to find the objects from the application under test.

The default path for this is mentioned below:

C:Usersadminandroid-sdkstools

C:Usersadmin – This is the location where I have installed Android SDK’s but it can be different as per the location specified during its installation.

Selendroid Device

Writing First Script Using APK Files Over Real Devices

Objective:

  • Start the server ( on default port say 4444)
  • Create a session
  • Install the application(.apk file) over the connected real device
  • Automate the text field with some data
  • Automatically click on the button
package SelendroidFirst;
import io.selendroid.client.SelendroidDriver;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.HttpClientBuilder;
import io.selendroid.common.SelendroidCapabilities;
import io.selendroid.common.device.DeviceTargetPlatform;
import io.selendroid.standalone.SelendroidConfiguration;
import io.selendroid.standalone.SelendroidLauncher;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeSuite;
import org.testng.annotations.Test;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.remote.*;
import static org.openqa.selenium.remote.CapabilityType.BROWSER_NAME;
import static org.openqa.selenium.remote.CapabilityType.PLATFORM;
import static org.openqa.selenium.remote.CapabilityType.VERSION;
public class RealDevices{

public SelendroidLauncher selendroidServer = null;
public WebDriver driver = null;
public void conf() throws Exception
{
//**Configuration**//
SelendroidConfiguration config = new SelendroidConfiguration();
config.addSupportedApp("G:\Jars\selendroid-test-app-0.8.0.apk");
SelendroidLauncher selendroidServer = new SelendroidLauncher(config);
selendroidServer.launchSelendroid();

//**Creating capabilities**//
SelendroidCapabilities sc = new SelendroidCapabilities(); sc.setAut("io.selendroid.testapp:0.8.0");	
sc.setEmulator(false);

//**Instantiating new Selendroid driver**//
WebDriver driver = new SelendroidDriver(sc);

//**Sending data to the text field**//
driver.findElement(By.id("my_text_field")).sendKeys("Selendroid Test");

//**Clicking on the button**//
driver.findElement(By.id("visibleButtonTest")).click();
Thread.sleep(10000);
}

Conclusion

Selendroid is a very powerful automation test framework tool which can be used to test native, hybrid as well as a web app on any Android device as well as a simulator.

It supports Hotplugging, which means a user can have multiple devices tested at a time hence parallel test execution is possible across multiple devices. It supports various kind of interactions like long press, touch actions etc…

Only complexity with it is the environmental setup, which is also there in other frameworks. Once it is setup correctly then we can have our scripts running without any difficulties.

In part 2 of this Selendoid tutorial, we will cover – How to use Selendroid framework to automate the user interactions over a mobile application.

In our next article, we will discuss more on pCloudy Hands-on Review Tutorial.

Related

Best Iptv Service Provider 2023 With 40k+ Channels And 150k+ VOD . Hurry Up

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • IPTV List: Best iptv lista 2023
  • IPTV Premium: Best Premium IPTV Service Provider List And Benefits
  • Nikon IPTV Review: Over 10,000 Live Channels for $12/Month
  • Iptvwings. Com Review: +18000 Live IPTV Channels ,+70000 Movies, +40000 TV show For $15/1 month
  • IPTVUNO Review: More Than 16000 Live TV channels, 55,000 Movies & VOD For $15/Month

Recent Comments

  1. IPTV List: Play lista iptv 2022 - Iptv Assist on Best IPTV Player in 2023 for Watching Live TV
  2. Cola IPTV – Over 18,000 Live Channels for $12/Month - Iptv Assist on FileLinked – How to Install on Firestick/Fire TV and Android Devices
  3. Cola IPTV – Over 18,000 Live Channels for $12/Month - Iptv Assist on 50+ Best IPTV Service Providers for Streaming Live TV 2023
  4. XoomsTV IPTV – Over 11,000 Channels & VOD for Under $13/Month on Best VPN for IPTV in 2023 and How to Install on Firestick/Android
  5. Voodoo Streams IPTV Review – Over 12,000 Channels for $11/Month - Iptv Assist on Dynasty TV IPTV Review – Over 6,000 Channels for $10/Month

Archives

  • January 2023

Categories

  • Activate
  • Agile Testing
  • Alternatives
  • Android
  • APK
  • Apple TV
  • Automation Testing
  • Basics of Software Testing
  • Best Apps
  • Breakfast Hours
  • Bug Defect tracking
  • Career in Software Testing
  • Chromebook
  • Chromecast
  • Cross Platform
  • Database Testing
  • Delete Account
  • Discord
  • Error Code
  • Firestick
  • Gaming
  • General
  • Google TV
  • Hisense Smart TV
  • HOW TO
  • Interview Questions
  • iPhone
  • IPTV
  • IPTV Apps
  • Iptv Service SP
  • IPTV Services
  • JVC Smart TV
  • Kodi
  • Lg Smart TV
  • Manual Testing
  • MI TV
  • Mobile Testing
  • Mod APK
  • newestiptv.com
  • News
  • Nintendo Switch
  • Panasonic Smart TV
  • PC Apps
  • Performance Testing
  • Philips Smart TV
  • PS4
  • PS5
  • Python
  • QA Certifications
  • QA Leadership
  • QA Team Skills
  • Quality Assurance
  • Reddit
  • Reviews
  • Roku
  • Samsung Smart TV
  • Screenshot
  • Selenium Tutorials
  • Sharp Smart TV
  • Skyworth Smart TV
  • Smart TV
  • Soft Skills For Testers
  • Software Testing Templates
  • Software Testing Tools
  • Software Testing Training
  • Sony Smart TV
  • Sports
  • Streaming Apps
  • Streaming Devices
  • Tech News
  • Test Management Tools
  • Test Strategy
  • Testing Best Practices
  • Testing Concepts
  • Testing Methodologies
  • Testing News
  • Testing Skill Improvement
  • Testing Tips and Resources
  • Toshiba Smart TV
  • Tutorials
  • Twitch
  • Types of Testing
  • Uncategorized
  • Vizio Smart TV
  • VPN
  • Web Testing
  • What is
  • Xbox
©2023 Iptv Assist | Design: Newspaperly WordPress Theme