SlideShare a Scribd company logo
Rajdeep Varma
Application Backdoor Via Appium
Up, Up, Down, Down, Left, Right, Left, Right
Rajdeep Varma
My name is
• Common issues in Mobile test Automation
• Solution — Backdoors
• Demo
• How we use Backdoors at Badoo
Agenda
Problem #1
FLAKY App
Problem #2
Driver Limits
Problem #2
Weather refreshing every 30
min.
How to automate this case?
Problem #3
• Firstly, Login takes 30 seconds
• And Then dismissing “What’s new” takes another 30 sec
• I don’t want to repeat this in each test
Our tests are so slow.
Appium
Backdoors
public class LoginActivity extends Activity {
public void foo() {
// code to set some app state
// Or seed DB before test
// Or Disable ‘Rate Us’ popup
}
}
public class LoginActivity extends Activity {
public void foo() {
// code to set some app state
// Or seed DB before test
// Or Disable ‘Rate Us’ popup
}
}
Demo
• Change Backend URLs
• Change App Locale
• Getting session_id from app
• Disable “What’s new” tutorials after login
Where do we use Backdoors?
• Disable client side A/B tests
• Faking SIM card for payments
• Get Analytics data from app to validate it
Where do we use Backdoors?
How?
Appium
Client
AppUnderTest apk
J
S
O
N
W
P
Android DeviceAutomation Code
androidTest
apk
Uiautomator2Server
apk
Appium
Client
AppUnderTest apk
J
S
O
N
W
P
Android DeviceAutomation Code
androidTest
apk
Uiautomator2Server
apk
Instrumentation
UiAutomator2
Appium
Client
AppUnderTest apk
J
S
O
N
W
P
Android DeviceAutomation Code
androidTest
apk
Uiautomator2Server
apk
Instrumentation
UiAutomator2
Appium
Client
AppUnderTest apk
J
S
O
N
W
P
Android DeviceAutomation Code
UiAutomator2
androidTest
apk
Appium
Client
AppUnderTest apk
J
S
O
N
W
P
Android DeviceAutomation Code
UiAutomator2
androidTest
apk
Instrumentation
Moving to single uiautomator2
server apk
•https://github.com/rajdeepv/appium-uiautomator2-
server/tree/single_apk
•There is a special backdoor handler in above fork
•gradle clean assembleServerDebugAndroidTest
<instrumentation
android:name=
"android.support.test.runner.AndroidJUnitRunner"
android:functionalTest="false"
android:handleProfiling="false"
android:label="Tests for io.appium.uiautomator2.server"
android:targetPackage="io.appium.uiautomator2.server"
/>
appium-uiautomator2-server-debug-androidTest.apk
<instrumentation
android:name=
"android.support.test.runner.AndroidJUnitRunner"
android:functionalTest="false"
android:handleProfiling="false"
android:label="Tests for io.appium.uiautomator2.server"
android:targetPackage="io.appium.uiautomator2.server"
/>
appium-uiautomator2-server-debug-androidTest.apk
<instrumentation
android:name=
"android.support.test.runner.AndroidJUnitRunner"
android:functionalTest="false"
android:handleProfiling="false"
android:label="Tests for io.appium.uiautomator2.server"
android:targetPackage="our.application.package"
/>
appium-uiautomator2-server-debug-androidTest.apk
$ gem install 'appium_instrumenter'
$ appium_instrumenter instrument my_app.apk
$ gem install 'appium_instrumenter'
$ appium_instrumenter instrument my_app.apk
$ adb install appium-uiautomator2-server-debug-
androidTest.apk
$ adb install appium-uiautomator2-server-
v0.3.0.apk
On Client side..
curl -X POST -H "Content-Type: application/json"
http://localhost:<forwarded_port>/wd/hub/sess
ion/:sessionId/backdoor
-d
'{"methods":[{"name":"<method>",
"args":["<method_arg>"]}]}'
On Client side..
def backdoor(*args)
url =
"http://localhost:#{FORWARDED_PORT}"+
“/wd/hub/session/:sessionId/backdoor"
body = {'methods' => args}.to_json
# code to post data
end
On Client side..
def backdoor(*args)
url =
"http://localhost:#{FORWARDED_PORT}"+
“/wd/hub/session/:sessionId/backdoor"
body = {'methods' => args}.to_json
# code to post data
end
backdoor({name:”methodName",args:["Arg"]})
Quiz
1. Add a backdoor method to change refersh interval:
changeRefreshInterval(time)
2. Add a backdoor method to refresh weather
refreshWeather()
Weather refresh every 30 min. How will you
test this case?
• https://developer.android.com/reference/android/app/Instrumentation.html
• https://developer.xamarin.com/guides/testcloud/calabash/working-with/backdoors/
• https://techblog.badoo.com/blog/2014/10/09/calabash-android-query/
• https://github.com/calabash/calabash-android
• https://github.com/calabash/calabash-android-server
References
Thank you!
Rajdeep Varma
mail.rajvarma@gmail.com
rajdeepv
@varmarajdeep

More Related Content

What's hot

What's hot (15)

An Introduction to Appium Desktop
An Introduction to Appium DesktopAn Introduction to Appium Desktop
An Introduction to Appium Desktop
 
Automation of Security scanning easy or cheese?
Automation of Security scanning easy or cheese?Automation of Security scanning easy or cheese?
Automation of Security scanning easy or cheese?
 
Mobile Test Automation
Mobile Test AutomationMobile Test Automation
Mobile Test Automation
 
Getting started with Visual Testing using Applitools - @TPC, Feb2020
Getting started with Visual Testing using Applitools - @TPC, Feb2020Getting started with Visual Testing using Applitools - @TPC, Feb2020
Getting started with Visual Testing using Applitools - @TPC, Feb2020
 
Cross Platform Appium Tests: How To
Cross Platform Appium Tests: How ToCross Platform Appium Tests: How To
Cross Platform Appium Tests: How To
 
SauceCon 2017: Mobile Test Pyramid
SauceCon 2017: Mobile Test PyramidSauceCon 2017: Mobile Test Pyramid
SauceCon 2017: Mobile Test Pyramid
 
Vietnam qa meetup
Vietnam qa meetupVietnam qa meetup
Vietnam qa meetup
 
Uncovering breaking changes behind UI on mobile applications
Uncovering breaking changes behind UI on mobile applicationsUncovering breaking changes behind UI on mobile applications
Uncovering breaking changes behind UI on mobile applications
 
How to pass a coding interview as an automation developer talk - Oct 17 2016
How to pass a coding interview as an automation developer talk - Oct 17 2016How to pass a coding interview as an automation developer talk - Oct 17 2016
How to pass a coding interview as an automation developer talk - Oct 17 2016
 
Advanced Appium Tips & Tricks with Jonathan Lipps
Advanced Appium Tips & Tricks with Jonathan LippsAdvanced Appium Tips & Tricks with Jonathan Lipps
Advanced Appium Tips & Tricks with Jonathan Lipps
 
b4usolution_Appium Mobile Automation Testing Made Awesome
b4usolution_AppiumMobile Automation Testing Made Awesomeb4usolution_AppiumMobile Automation Testing Made Awesome
b4usolution_Appium Mobile Automation Testing Made Awesome
 
Hassle-Free Continuous Integration with Real Device Testing
Hassle-Free Continuous Integration with Real Device TestingHassle-Free Continuous Integration with Real Device Testing
Hassle-Free Continuous Integration with Real Device Testing
 
Appium workshop technopark trivandrum
Appium workshop technopark trivandrumAppium workshop technopark trivandrum
Appium workshop technopark trivandrum
 
What's New With Appium? From 1.0 to Now
What's New With Appium? From 1.0 to NowWhat's New With Appium? From 1.0 to Now
What's New With Appium? From 1.0 to Now
 
Mobile Automation with Appium
Mobile Automation with AppiumMobile Automation with Appium
Mobile Automation with Appium
 

Similar to appium backdoors

Similar to appium backdoors (20)

Eradicate Flaky Tests - AppiumConf 2021
Eradicate Flaky Tests - AppiumConf 2021Eradicate Flaky Tests - AppiumConf 2021
Eradicate Flaky Tests - AppiumConf 2021
 
Appium meet up noida
Appium meet up noidaAppium meet up noida
Appium meet up noida
 
Eradicate Flaky Tests
Eradicate Flaky TestsEradicate Flaky Tests
Eradicate Flaky Tests
 
Being Epic: Best Practices for Android Development
Being Epic: Best Practices for Android DevelopmentBeing Epic: Best Practices for Android Development
Being Epic: Best Practices for Android Development
 
Introduction to Titanium and how to connect with a PHP backend
Introduction to Titanium and how to connect with a PHP backendIntroduction to Titanium and how to connect with a PHP backend
Introduction to Titanium and how to connect with a PHP backend
 
[@NaukriEngineering] Mobile Web app scripts execution using Appium
[@NaukriEngineering] Mobile Web app scripts execution using Appium[@NaukriEngineering] Mobile Web app scripts execution using Appium
[@NaukriEngineering] Mobile Web app scripts execution using Appium
 
How to Leverage Appium in Your Mobile App Testing
How to Leverage Appium in Your Mobile App TestingHow to Leverage Appium in Your Mobile App Testing
How to Leverage Appium in Your Mobile App Testing
 
Getting started with Appium 2.0
Getting started with Appium 2.0Getting started with Appium 2.0
Getting started with Appium 2.0
 
Synthetic Monitoring Deep Dive - AppSphere16
Synthetic Monitoring Deep Dive - AppSphere16Synthetic Monitoring Deep Dive - AppSphere16
Synthetic Monitoring Deep Dive - AppSphere16
 
ICSE17Tech Briefing - Automated GUI Testing of Android Apps: From Research to...
ICSE17Tech Briefing - Automated GUI Testing of Android Apps: From Research to...ICSE17Tech Briefing - Automated GUI Testing of Android Apps: From Research to...
ICSE17Tech Briefing - Automated GUI Testing of Android Apps: From Research to...
 
Mobitop
MobitopMobitop
Mobitop
 
Mobitop
MobitopMobitop
Mobitop
 
Mobitop
MobitopMobitop
Mobitop
 
Mobitop
MobitopMobitop
Mobitop
 
How to kill test flake in appium
How to kill test flake in appiumHow to kill test flake in appium
How to kill test flake in appium
 
API Testing with Frisby and Mocha
API Testing with Frisby and MochaAPI Testing with Frisby and Mocha
API Testing with Frisby and Mocha
 
Building Drupal Apps for Distributions
Building Drupal Apps for DistributionsBuilding Drupal Apps for Distributions
Building Drupal Apps for Distributions
 
Overview the Challenges and Limitations of Android App Automation with Espres...
Overview the Challenges and Limitations of Android App Automation with Espres...Overview the Challenges and Limitations of Android App Automation with Espres...
Overview the Challenges and Limitations of Android App Automation with Espres...
 
End User Monitoring with AppDynamics - AppSphere16
End User Monitoring with AppDynamics - AppSphere16End User Monitoring with AppDynamics - AppSphere16
End User Monitoring with AppDynamics - AppSphere16
 
Metrics-Driven Devops: Delivering High Quality Software Faster!
Metrics-Driven Devops: Delivering High Quality Software Faster! Metrics-Driven Devops: Delivering High Quality Software Faster!
Metrics-Driven Devops: Delivering High Quality Software Faster!
 

appium backdoors

Editor's Notes

  1. 360 million registered user Android, iOS, Mobile web/Web
  2. Rate Us Never ending animations, resulting in some failed clicks A/B test ending up failed tests
  3. https://www.shutterstock.com/image-vector/phone-shake-icon-637798570?src=dyoXQCXqsKyr7aWHOJ7h0A-1-101 https://www.techcrises.com/wp-content/uploads/2016/12/shake_brightness_android.jpg
  4. https://www.shutterstock.com/image-vector/phone-shake-icon-637798570?src=dyoXQCXqsKyr7aWHOJ7h0A-1-101 https://www.techcrises.com/wp-content/uploads/2016/12/shake_brightness_android.jpg
  5. Backdoors are methods that can be invoked during a test run to perform some special action to configure or set up testing state of app.
  6. Why No Backdoors in Appium?