SlideShare a Scribd company logo
1 of 24
Download to read offline
Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.
1
Automated testing of mobile
applications on multiple
platforms
Markku Kero / Job and Esther Technologies
June 2014 / Softech.ph
Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.
2
What is the
meaning of “Mobile
UI Automation”?
Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.
3
Traditional QA procedure
… #100 … #1000 … hours and hours of testing … for each release …
Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.
4
UI Automation
Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.
5
import com.android.uiautomator.core.*;
import com.android.uiautomator.testrunner.*;
public class MyTestCase extends UiAutomatorTestCase
{
public void testnumberone() throws UiObjectNotFoundException,
android.os.RemoteException
{
getUiDevice().wakeUp();
getUiDevice().pressEnter();
UiObject textfield = new UiObject(new UiSelector().className("android.widget.EditText"));
textfield.clearTextField();
textfield.setText("This is really cool");
UiObject button = new UiObject(new UiSelector().className("android.widget.Button"));
button.click();
UiObject textview = new UiObject(new UiSelector().className("android.widget.TextView").index(1));
assertEquals("Text is incorrect", "This is really cool", textview.getText());
}
}
$ <apache-ant-dir>/bin/ant build
$ <adt-dir>/sdk/platform-tools adb push bin/MyTestProgram.jar /data/local/tmp
$ <adt-dir>/sdk/platform-tools/adb shell uiautomator runtest MyTestProgram.jar 
-c MyTestCase
1. Write the test program
2. Run the tests
3. Read the report
Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.
6
With automation, full test of an
app will no longer take hours
but minutes
The tests are easily repeated
for every release
Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.
7
Perfect, right?
Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.
.. FOR EACH PLATFORM
BUT TEST PROGRAMS NEED TO BE WRITTEN ..
Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.
MANY MOBILE PLATFORMS HAVE BUILT-IN CAPABILITIES
FOR USER INTERFACE AUTOMATION
UI Automation
JavaScript
UIAutomator
Java
Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.
Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.
Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.
public class Main : LayerWidget, EventReceiver
{
TextInputWidget input;
LabelWidget label;
public void initialize() {
base.initialize();
var box = BoxWidget.vertical().set_spacing(px("1mm"))
.set_margin(px("1mm"));
box.add(input = TextInputWidget.instance());
input.set_widget_id("input");
box.add(label = LabelWidget.for_string("(enter text)")
.set_font(Font.instance("7mm")));
box.add(ButtonWidget.for_string("Click me").set_event("clickme")
.set_widget_id("clickme"));
add(CanvasWidget.for_color(Color.instance("#AAAAAA")));
add(box);
set_draw_color(Color.instance("black"));
}
public void cleanup() {
base.cleanup();
input = null;
label = null;
}
public void on_event(Object o) {
label.set_text(input.get_text());
}
}
Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.
// standard iOS UI Automation framework initialization
var target = UIATarget.localTarget();
var app = target.frontMostApp();
var window = app.mainWindow();
// Set the contents of the text input field
// to string "Something"
window.textFields()["input"].setValue("Something");
// Click the "Click me" button
window.buttons()["clickme"].tap();
UI Automation test script for iOS
Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.
Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.
Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.
import com.android.uiautomator.core.*;
import com.android.uiautomator.testrunner.*;
public class MyTestCase extends UiAutomatorTestCase
{
public void testSample() throws
UiObjectNotFoundException,
android.os.RemoteException
{
UiObject textfield = new UiObject(new UiSelector()
.description("input"));
textfield.clearTextField();
textfield.setText("Something");
UiObject button = new UiObject(new UiSelector()
.description("clickme"));
button.click();
}
}
UIAutomator test script for Android
Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.
public class MyTestCase extends UiAutomatorTestCase
{
public void testSample() throws
UiObjectNotFoundException,
android.os.RemoteException
{
UiObject textfield = new UiObject(new UiSelector()
.description("input"));
textfield.clearTextField();
textfield.setText("Something");
UiObject button = new UiObject(new UiSelector()
.description("clickme"));
button.click();
}
}
var target = UIATarget.localTarget();
var app = target.frontMostApp();
var window = app.mainWindow();
window.textFields()["input"].setValue("Something");
window.buttons()["clickme"].tap();
SAME PROGRAM WRITTEN TWICE ..
.. SEEMS LIKE A WASTE OF EFFORT
Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.
BUT TWICE WOULD
NOT BE ENOUGH
Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.
19
Programming Language
Translator
Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.
class MyTestCase : UIAutomatorTestCase
{
public void execute() {
get_text_field("input").set_text("Something");
get_button("clickme").click();
}
}
package sample;
public class MyTestCase extends com.eqela.libuiautomator.UIAutomatorTestCase
{
@Override public void execute() {
((com.eqela.libuiautomator.UIAutomatorTestCase)this).get_text_field(eq.api.St
ringStatic.eq_api_StringStatic_for_strptr("input")).set_text(eq.api.StringSta
tic.eq_api_StringStatic_for_strptr("Something"));
((com.eqela.libuiautomator.UIAutomatorTestCase)this).get_button(eq.api.String
Static.eq_api_StringStatic_for_strptr("clickme")).click();
}
}
sample.MyTestCase=function(){
com.eqela.libuiautomator.UIAutomatorTestCase.call(this);
};
// ...
P.execute=function(){
com.eqela.libuiautomator.UIAutomatorTestCase.prototype.get_text_field.call(t
his,eq.api.StringStatic.for_strptr("input")).set_text(eq.api.StringStatic.fo
r_strptr("Something"));
com.eqela.libuiautomator.UIAutomatorTestCase.prototype.get_button.call(this,
eq.api.StringStatic.for_strptr("clickme")).click();
}
Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.
public class UIAutomatorTextFieldAndroid : UIAutomatorTextField
{
public static UIAutomatorTextFieldAndroid for_id(String id) {
return(new UIAutomatorTextFieldAndroid().initialize(id));
}
ptr field;
public UIAutomatorTextFieldAndroid initialize(String id) {
ptr ff;
var ip = id.to_strptr();
embed {{{
ff = new UiObject(new UiSelector().description(ip));
}}}
if(ff == null) {
return(null);
}
field = ff;
return(this);
}
public void set_text(String text) {
var ff = field;
var tp = text.to_strptr();
embed {{{
ff.clearTextField();
ff.setText(tp);
}}}
}
}
Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.
public class UIAutomatorTextFieldIOS : UIAutomatorTextField
{
public static UIAutomatorTextFieldIOS for_id(String id) {
return(new UIAutomatorTextFieldIOS().initialize(id));
}
ptr field;
public UIAutomatorTextFieldIOS initialize(String id) {
ptr ff;
var ip = id.to_strptr();
embed {{{
ff = window.textfields()[ip];
}}}
if(ff == null) {
return(null);
}
field = ff;
return(this);
}
public void set_text(String text) {
var ff = field;
var tp = text.to_strptr();
embed {{{
ff.setValue(tp);
}}}
}
}
Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.
public class MyTestCase extends UiAutomatorTestCase
{
public void testSample() throws
UiObjectNotFoundException,
android.os.RemoteException
{
UiObject textfield = new UiObject(new UiSelector()
.description("input"));
textfield.clearTextField();
textfield.setText("Something");
UiObject button = new UiObject(new UiSelector()
.description("clickme"));
button.click();
}
}
var target = UIATarget.localTarget();
var app = target.frontMostApp();
var window = app.mainWindow();
window.textFields()["input"].setValue("Something");
window.buttons()["clickme"].tap();
NO WASTED EFFORT. WRITE THE SCRIPT ONLY ONCE
class MyTestCase : UIAutomatorTestCase
{
public void execute() {
get_text_field("input").set_text("Something");
get_button("clickme").click();
}
}
Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.
24
Ask for more information
markku.kero@jobandesther.com
www.jobandesther.com
www.eqela.com

More Related Content

Viewers also liked

Optimized Cross Platform Development
Optimized Cross Platform DevelopmentOptimized Cross Platform Development
Optimized Cross Platform Developmentjobandesther
 
Eqela Core API and Utilities
Eqela Core API and UtilitiesEqela Core API and Utilities
Eqela Core API and Utilitiesjobandesther
 
Eqela Web Development with Database Connectivity
Eqela Web Development with Database ConnectivityEqela Web Development with Database Connectivity
Eqela Web Development with Database ConnectivityEqela
 
Mobile Game Development With Eqela (March 2014)
Mobile Game Development With Eqela (March 2014)Mobile Game Development With Eqela (March 2014)
Mobile Game Development With Eqela (March 2014)jobandesther
 
Mobile Game Development Using Eqela
Mobile Game Development Using EqelaMobile Game Development Using Eqela
Mobile Game Development Using EqelaEqela
 
Pengertian,kekurangan dan kelebihan,dan menginstallnya Prestashop,Opencart,SM...
Pengertian,kekurangan dan kelebihan,dan menginstallnya Prestashop,Opencart,SM...Pengertian,kekurangan dan kelebihan,dan menginstallnya Prestashop,Opencart,SM...
Pengertian,kekurangan dan kelebihan,dan menginstallnya Prestashop,Opencart,SM...muhamadpandu1
 

Viewers also liked (6)

Optimized Cross Platform Development
Optimized Cross Platform DevelopmentOptimized Cross Platform Development
Optimized Cross Platform Development
 
Eqela Core API and Utilities
Eqela Core API and UtilitiesEqela Core API and Utilities
Eqela Core API and Utilities
 
Eqela Web Development with Database Connectivity
Eqela Web Development with Database ConnectivityEqela Web Development with Database Connectivity
Eqela Web Development with Database Connectivity
 
Mobile Game Development With Eqela (March 2014)
Mobile Game Development With Eqela (March 2014)Mobile Game Development With Eqela (March 2014)
Mobile Game Development With Eqela (March 2014)
 
Mobile Game Development Using Eqela
Mobile Game Development Using EqelaMobile Game Development Using Eqela
Mobile Game Development Using Eqela
 
Pengertian,kekurangan dan kelebihan,dan menginstallnya Prestashop,Opencart,SM...
Pengertian,kekurangan dan kelebihan,dan menginstallnya Prestashop,Opencart,SM...Pengertian,kekurangan dan kelebihan,dan menginstallnya Prestashop,Opencart,SM...
Pengertian,kekurangan dan kelebihan,dan menginstallnya Prestashop,Opencart,SM...
 

Similar to Automated testing of mobile applications on multiple platforms

What do you mean it needs to be Java based? How jython saved the day.
What do you mean it needs to be Java based? How jython saved the day.What do you mean it needs to be Java based? How jython saved the day.
What do you mean it needs to be Java based? How jython saved the day.Mark Rees
 
2011 py con
2011 py con2011 py con
2011 py conEing Ong
 
Imagine a world without mocks
Imagine a world without mocksImagine a world without mocks
Imagine a world without mockskenbot
 
Unit & Automation Testing in Android - Stanislav Gatsev, Melon
Unit & Automation Testing in Android - Stanislav Gatsev, MelonUnit & Automation Testing in Android - Stanislav Gatsev, Melon
Unit & Automation Testing in Android - Stanislav Gatsev, MelonbeITconference
 
Security Testing
Security TestingSecurity Testing
Security TestingKiran Kumar
 
Vaadin 7 CN
Vaadin 7 CNVaadin 7 CN
Vaadin 7 CNjojule
 
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...mharkus
 
100% Code Coverage - TDD mit Java EE
100% Code Coverage - TDD mit Java EE100% Code Coverage - TDD mit Java EE
100% Code Coverage - TDD mit Java EEStefan Macke
 
Android101 : Introduksjon til Android
Android101 : Introduksjon til AndroidAndroid101 : Introduksjon til Android
Android101 : Introduksjon til AndroidTruls Jørgensen
 
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageabilityDaniel Fisher
 
Mobile HTML, CSS, and JavaScript
Mobile HTML, CSS, and JavaScriptMobile HTML, CSS, and JavaScript
Mobile HTML, CSS, and JavaScriptfranksvalli
 
2012 star west-t10
2012 star west-t102012 star west-t10
2012 star west-t10Eing Ong
 
J2ME Lwuit, Storage & Connections (Ft Prasanjit Dey)
J2ME Lwuit, Storage & Connections (Ft   Prasanjit Dey)J2ME Lwuit, Storage & Connections (Ft   Prasanjit Dey)
J2ME Lwuit, Storage & Connections (Ft Prasanjit Dey)Fafadia Tech
 
How React Native, Appium and me made each other shine @Frontmania 16-11-2018
How React Native, Appium and me made each other shine @Frontmania 16-11-2018How React Native, Appium and me made each other shine @Frontmania 16-11-2018
How React Native, Appium and me made each other shine @Frontmania 16-11-2018Wim Selles
 
Testing with VS2010 - A Bugs Life
Testing with VS2010 - A Bugs LifeTesting with VS2010 - A Bugs Life
Testing with VS2010 - A Bugs LifePeter Gfader
 
Use Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEUse Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEBenjamin Cabé
 
Scala for Test Automation
Scala for Test AutomationScala for Test Automation
Scala for Test Automationrthanavarapu
 

Similar to Automated testing of mobile applications on multiple platforms (20)

Google Web Toolkit
Google Web ToolkitGoogle Web Toolkit
Google Web Toolkit
 
What do you mean it needs to be Java based? How jython saved the day.
What do you mean it needs to be Java based? How jython saved the day.What do you mean it needs to be Java based? How jython saved the day.
What do you mean it needs to be Java based? How jython saved the day.
 
mobl
moblmobl
mobl
 
2011 py con
2011 py con2011 py con
2011 py con
 
Imagine a world without mocks
Imagine a world without mocksImagine a world without mocks
Imagine a world without mocks
 
Unit & Automation Testing in Android - Stanislav Gatsev, Melon
Unit & Automation Testing in Android - Stanislav Gatsev, MelonUnit & Automation Testing in Android - Stanislav Gatsev, Melon
Unit & Automation Testing in Android - Stanislav Gatsev, Melon
 
Security Testing
Security TestingSecurity Testing
Security Testing
 
Vaadin 7 CN
Vaadin 7 CNVaadin 7 CN
Vaadin 7 CN
 
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
 
100% Code Coverage - TDD mit Java EE
100% Code Coverage - TDD mit Java EE100% Code Coverage - TDD mit Java EE
100% Code Coverage - TDD mit Java EE
 
Android101 : Introduksjon til Android
Android101 : Introduksjon til AndroidAndroid101 : Introduksjon til Android
Android101 : Introduksjon til Android
 
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability
 
Mobile HTML, CSS, and JavaScript
Mobile HTML, CSS, and JavaScriptMobile HTML, CSS, and JavaScript
Mobile HTML, CSS, and JavaScript
 
2012 star west-t10
2012 star west-t102012 star west-t10
2012 star west-t10
 
Day 5
Day 5Day 5
Day 5
 
J2ME Lwuit, Storage & Connections (Ft Prasanjit Dey)
J2ME Lwuit, Storage & Connections (Ft   Prasanjit Dey)J2ME Lwuit, Storage & Connections (Ft   Prasanjit Dey)
J2ME Lwuit, Storage & Connections (Ft Prasanjit Dey)
 
How React Native, Appium and me made each other shine @Frontmania 16-11-2018
How React Native, Appium and me made each other shine @Frontmania 16-11-2018How React Native, Appium and me made each other shine @Frontmania 16-11-2018
How React Native, Appium and me made each other shine @Frontmania 16-11-2018
 
Testing with VS2010 - A Bugs Life
Testing with VS2010 - A Bugs LifeTesting with VS2010 - A Bugs Life
Testing with VS2010 - A Bugs Life
 
Use Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEUse Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDE
 
Scala for Test Automation
Scala for Test AutomationScala for Test Automation
Scala for Test Automation
 

Recently uploaded

Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 

Recently uploaded (20)

Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 

Automated testing of mobile applications on multiple platforms

  • 1. Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved. 1 Automated testing of mobile applications on multiple platforms Markku Kero / Job and Esther Technologies June 2014 / Softech.ph
  • 2. Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved. 2 What is the meaning of “Mobile UI Automation”?
  • 3. Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved. 3 Traditional QA procedure … #100 … #1000 … hours and hours of testing … for each release …
  • 4. Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved. 4 UI Automation
  • 5. Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved. 5 import com.android.uiautomator.core.*; import com.android.uiautomator.testrunner.*; public class MyTestCase extends UiAutomatorTestCase { public void testnumberone() throws UiObjectNotFoundException, android.os.RemoteException { getUiDevice().wakeUp(); getUiDevice().pressEnter(); UiObject textfield = new UiObject(new UiSelector().className("android.widget.EditText")); textfield.clearTextField(); textfield.setText("This is really cool"); UiObject button = new UiObject(new UiSelector().className("android.widget.Button")); button.click(); UiObject textview = new UiObject(new UiSelector().className("android.widget.TextView").index(1)); assertEquals("Text is incorrect", "This is really cool", textview.getText()); } } $ <apache-ant-dir>/bin/ant build $ <adt-dir>/sdk/platform-tools adb push bin/MyTestProgram.jar /data/local/tmp $ <adt-dir>/sdk/platform-tools/adb shell uiautomator runtest MyTestProgram.jar -c MyTestCase 1. Write the test program 2. Run the tests 3. Read the report
  • 6. Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved. 6 With automation, full test of an app will no longer take hours but minutes The tests are easily repeated for every release
  • 7. Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved. 7 Perfect, right?
  • 8. Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved. .. FOR EACH PLATFORM BUT TEST PROGRAMS NEED TO BE WRITTEN ..
  • 9. Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved. MANY MOBILE PLATFORMS HAVE BUILT-IN CAPABILITIES FOR USER INTERFACE AUTOMATION UI Automation JavaScript UIAutomator Java
  • 10. Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.
  • 11. Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.
  • 12. Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved. public class Main : LayerWidget, EventReceiver { TextInputWidget input; LabelWidget label; public void initialize() { base.initialize(); var box = BoxWidget.vertical().set_spacing(px("1mm")) .set_margin(px("1mm")); box.add(input = TextInputWidget.instance()); input.set_widget_id("input"); box.add(label = LabelWidget.for_string("(enter text)") .set_font(Font.instance("7mm"))); box.add(ButtonWidget.for_string("Click me").set_event("clickme") .set_widget_id("clickme")); add(CanvasWidget.for_color(Color.instance("#AAAAAA"))); add(box); set_draw_color(Color.instance("black")); } public void cleanup() { base.cleanup(); input = null; label = null; } public void on_event(Object o) { label.set_text(input.get_text()); } }
  • 13. Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved. // standard iOS UI Automation framework initialization var target = UIATarget.localTarget(); var app = target.frontMostApp(); var window = app.mainWindow(); // Set the contents of the text input field // to string "Something" window.textFields()["input"].setValue("Something"); // Click the "Click me" button window.buttons()["clickme"].tap(); UI Automation test script for iOS
  • 14. Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.
  • 15. Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.
  • 16. Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved. import com.android.uiautomator.core.*; import com.android.uiautomator.testrunner.*; public class MyTestCase extends UiAutomatorTestCase { public void testSample() throws UiObjectNotFoundException, android.os.RemoteException { UiObject textfield = new UiObject(new UiSelector() .description("input")); textfield.clearTextField(); textfield.setText("Something"); UiObject button = new UiObject(new UiSelector() .description("clickme")); button.click(); } } UIAutomator test script for Android
  • 17. Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved. public class MyTestCase extends UiAutomatorTestCase { public void testSample() throws UiObjectNotFoundException, android.os.RemoteException { UiObject textfield = new UiObject(new UiSelector() .description("input")); textfield.clearTextField(); textfield.setText("Something"); UiObject button = new UiObject(new UiSelector() .description("clickme")); button.click(); } } var target = UIATarget.localTarget(); var app = target.frontMostApp(); var window = app.mainWindow(); window.textFields()["input"].setValue("Something"); window.buttons()["clickme"].tap(); SAME PROGRAM WRITTEN TWICE .. .. SEEMS LIKE A WASTE OF EFFORT
  • 18. Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved. BUT TWICE WOULD NOT BE ENOUGH
  • 19. Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved. 19 Programming Language Translator
  • 20. Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved. class MyTestCase : UIAutomatorTestCase { public void execute() { get_text_field("input").set_text("Something"); get_button("clickme").click(); } } package sample; public class MyTestCase extends com.eqela.libuiautomator.UIAutomatorTestCase { @Override public void execute() { ((com.eqela.libuiautomator.UIAutomatorTestCase)this).get_text_field(eq.api.St ringStatic.eq_api_StringStatic_for_strptr("input")).set_text(eq.api.StringSta tic.eq_api_StringStatic_for_strptr("Something")); ((com.eqela.libuiautomator.UIAutomatorTestCase)this).get_button(eq.api.String Static.eq_api_StringStatic_for_strptr("clickme")).click(); } } sample.MyTestCase=function(){ com.eqela.libuiautomator.UIAutomatorTestCase.call(this); }; // ... P.execute=function(){ com.eqela.libuiautomator.UIAutomatorTestCase.prototype.get_text_field.call(t his,eq.api.StringStatic.for_strptr("input")).set_text(eq.api.StringStatic.fo r_strptr("Something")); com.eqela.libuiautomator.UIAutomatorTestCase.prototype.get_button.call(this, eq.api.StringStatic.for_strptr("clickme")).click(); }
  • 21. Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved. public class UIAutomatorTextFieldAndroid : UIAutomatorTextField { public static UIAutomatorTextFieldAndroid for_id(String id) { return(new UIAutomatorTextFieldAndroid().initialize(id)); } ptr field; public UIAutomatorTextFieldAndroid initialize(String id) { ptr ff; var ip = id.to_strptr(); embed {{{ ff = new UiObject(new UiSelector().description(ip)); }}} if(ff == null) { return(null); } field = ff; return(this); } public void set_text(String text) { var ff = field; var tp = text.to_strptr(); embed {{{ ff.clearTextField(); ff.setText(tp); }}} } }
  • 22. Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved. public class UIAutomatorTextFieldIOS : UIAutomatorTextField { public static UIAutomatorTextFieldIOS for_id(String id) { return(new UIAutomatorTextFieldIOS().initialize(id)); } ptr field; public UIAutomatorTextFieldIOS initialize(String id) { ptr ff; var ip = id.to_strptr(); embed {{{ ff = window.textfields()[ip]; }}} if(ff == null) { return(null); } field = ff; return(this); } public void set_text(String text) { var ff = field; var tp = text.to_strptr(); embed {{{ ff.setValue(tp); }}} } }
  • 23. Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved. public class MyTestCase extends UiAutomatorTestCase { public void testSample() throws UiObjectNotFoundException, android.os.RemoteException { UiObject textfield = new UiObject(new UiSelector() .description("input")); textfield.clearTextField(); textfield.setText("Something"); UiObject button = new UiObject(new UiSelector() .description("clickme")); button.click(); } } var target = UIATarget.localTarget(); var app = target.frontMostApp(); var window = app.mainWindow(); window.textFields()["input"].setValue("Something"); window.buttons()["clickme"].tap(); NO WASTED EFFORT. WRITE THE SCRIPT ONLY ONCE class MyTestCase : UIAutomatorTestCase { public void execute() { get_text_field("input").set_text("Something"); get_button("clickme").click(); } }
  • 24. Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved. 24 Ask for more information markku.kero@jobandesther.com www.jobandesther.com www.eqela.com