SlideShare a Scribd company logo
1 of 28
Xamarin UI Test
And
Xamarin Test Cloud
Gavin Bryan
(Freelance Certified Xamarin Developer)
Overview
• Xamarin UI Test
• How and where Xamarin UI Tests can be run
• Xamarin Test Cloud
What is Xamarin UI Test?
• Automation Test Library
• Automate mobile device and application
• Automated UI Acceptance Tests written in
nunit (2.6.x) to be run against iOS and Android
• Can be used on Xamarin Apps, iOS (objective-c
/ Swift Apps) and Native Android Apps
• XTC does not support WP or Xamarin Forms
WP
Creating a Xamarin.UITest Project
Xamarin Studio has 3 Project Templates
1. MultiPlatform
Creating a Xamarin.UITest Project
2. IOS Template
Creating a Xamarin.UITest Project
3. Android Template
Most Simple Test
• [Test]
• public void MyFirstUITest()
• {
• var app = ConfigureApp
• .Android
• .ApkFile("MyApkFile.apk")
• .StartApp();
•
• app.EnterText("NameField", ”John Smith");
• app.Tap("SubmitButton");
• }
UITest Anatomy
• Uses a client / server communication using
http and json.
• Http server runs on the device
• Communicates with UI Test Client Agent
Android
• Xamarin Test Cloud Agent Server runs in it’s
own separate process
• Process is signed with the same keystore as
your application so it can drive it with the
Android Automation APIs
iOS
• Due to iOS restrictions on iOS the Xamarin
Test Cloud Agent has to be shipped with your
app in the bundle
• This allows it to access the iOS automation
APIs
• Xamarin Test Cloud Agent nuget needs to be
installed
Quick Example
app.Tap (c => c.Marked (”New"));
app.EnterText(c => c.Class("UITextField")
.Index(0), ”John Smith");
app.Tap (c => c.Marked ("Save"));
nUnit
• Test Fixture
• 3 A’s (Arrange / Act / Assert)
• Categories
• Demo – Create Android / IOS Project
UI Test Workflow
• Write automation tests while developing
feature
• Write tests, run locally to validate functionality
• Create Test run to run in CI / XTC etc.
UI Test Infrastructure
• Tests rely heavily on queries to locate UI
elements
• Different techniques to share test logic
between platforms
• Your tests can be cross-platform if you write
them in similar manner to cross-platform
apps.
Setting UI Elements
• Need a way for UI Test to identify UI Elements
• UI Test use different UI element ID on Android
and iOS
• Can you just text to identify element, but not
a good practice.
Android IDs
• Generally your normal android:id tag is best
identifier.
• e.g. android:id="@+id/submitButton"
• This is then used by UI Test
• app.Tap (x => x.Id ("submitButton"))
iOS Element IDs
• UI Element Accessibility Identifier
• UI Element Accessibility Label
• Can set in XCode Identity Inspector or in Code
Identifying UI Elements
• REPL (read, eval, print, loop)
• Android - Dump View Hierarchy for UI
Automator
• DEMO 1
UI Test Basics
• IApp – different implementations on Android
and iOS
• Use ConfigApp fluent builder to create
implementation on each platform
• Lots of methods and properties
Xamarin Test Recorder
• A tool for recording automated user interface
tests.
• Can be used on Android and iOS
• Android runs as standalone app
• iOS embeds a plugin into your app bundle to
run (make this is removed on app submission)
• Demo 2
Where Can You Run Your Tests
• Locally (devices or emulators / simulators)
• CI environments (TeamCity, VSTS, VSMC,
Jenkins, Bitrise etc.)
• Xamarin Test Cloud (XTC)
Command Line
• Run locally :-
nunit-console.exe in nuget package Nunit.Runners (2.6.4)
• Send to Test Cloud :-
• test-cloud.exe
Find Device Ids
• Android :- adb devices
• iOS - xcrun instruments -s devices (ios get local
devices) or Xcode
• Demo 3
Xamarin Test Cloud
• Test your app on hundreds of actual devices in
the Cloud (2000)
• Select Subset of devices to test on
• Very detailed analysis of your app
• Upload APK, IPA with UI Test Project
• iOS IPA are re-signed by Xamarin using their
own provisioning profiles
XTC
• Xamarin resigns your iOS app with their
provisioning profile so they can run on their
devices.
Some XTC Analysis
• Screenshots
• Memory Usage Profiling
• CPU Usage
• Test logs
• Device logs
• Demo 4
Thank You
• Any Questions ?

More Related Content

What's hot

What's hot (20)

Mvvm is like born fraction
Mvvm is like born fractionMvvm is like born fraction
Mvvm is like born fraction
 
Titanium @ Minnebar
Titanium @ MinnebarTitanium @ Minnebar
Titanium @ Minnebar
 
Contributing to open source
Contributing to open sourceContributing to open source
Contributing to open source
 
React UI Development: Introduction to "UI Component as API"
React UI Development: Introduction to "UI Component as API"React UI Development: Introduction to "UI Component as API"
React UI Development: Introduction to "UI Component as API"
 
Xamarin forms introduction by Taswar Bhatti and Ahmed Assad
Xamarin forms introduction by Taswar Bhatti and Ahmed AssadXamarin forms introduction by Taswar Bhatti and Ahmed Assad
Xamarin forms introduction by Taswar Bhatti and Ahmed Assad
 
Test Inside Containers: Dockerise Appium Tests
Test Inside Containers: Dockerise Appium TestsTest Inside Containers: Dockerise Appium Tests
Test Inside Containers: Dockerise Appium Tests
 
React Native - Unleash the power of React in your device - Eduard Tomàs - Cod...
React Native - Unleash the power of React in your device - Eduard Tomàs - Cod...React Native - Unleash the power of React in your device - Eduard Tomàs - Cod...
React Native - Unleash the power of React in your device - Eduard Tomàs - Cod...
 
An Introduction to ReactNative
An Introduction to ReactNativeAn Introduction to ReactNative
An Introduction to ReactNative
 
Introduction to React Native & Rendering Charts / Graphs
Introduction to React Native & Rendering Charts / GraphsIntroduction to React Native & Rendering Charts / Graphs
Introduction to React Native & Rendering Charts / Graphs
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
 
Experiences building apps with React Native @UtrechtJS May 2016
Experiences building apps with React Native @UtrechtJS May 2016Experiences building apps with React Native @UtrechtJS May 2016
Experiences building apps with React Native @UtrechtJS May 2016
 
I Love APIs - Oct 2015
I Love APIs - Oct 2015I Love APIs - Oct 2015
I Love APIs - Oct 2015
 
Automated UI Testing Frameworks
Automated UI Testing FrameworksAutomated UI Testing Frameworks
Automated UI Testing Frameworks
 
ng-conf NativeScript and Angular 2 Workshop
ng-conf NativeScript and Angular 2 Workshopng-conf NativeScript and Angular 2 Workshop
ng-conf NativeScript and Angular 2 Workshop
 
Getting started with appium
Getting started with appiumGetting started with appium
Getting started with appium
 
Cross platform development
Cross platform developmentCross platform development
Cross platform development
 
Xamarin for (not only) Android developers
Xamarin for (not only) Android developersXamarin for (not only) Android developers
Xamarin for (not only) Android developers
 
Introduction to Android with C# using Xamarin
Introduction to Android with C# using XamarinIntroduction to Android with C# using Xamarin
Introduction to Android with C# using Xamarin
 
Flex on Grails - Rich Internet Applications With Rapid Application Development
Flex on Grails - Rich Internet Applications With Rapid Application DevelopmentFlex on Grails - Rich Internet Applications With Rapid Application Development
Flex on Grails - Rich Internet Applications With Rapid Application Development
 
Creating iOS and Android Apps with Visual Studio and C#
Creating iOS and Android Apps with Visual Studio and C# Creating iOS and Android Apps with Visual Studio and C#
Creating iOS and Android Apps with Visual Studio and C#
 

Viewers also liked

Building android apps using xamarin
Building android apps using xamarinBuilding android apps using xamarin
Building android apps using xamarin
Nitesh Luharuka
 
SEMINAR ON Bluetooth Hotspot
SEMINAR ON Bluetooth HotspotSEMINAR ON Bluetooth Hotspot
SEMINAR ON Bluetooth Hotspot
Kamonasish Hore
 
Examples of smart_objective_attributes
Examples of smart_objective_attributesExamples of smart_objective_attributes
Examples of smart_objective_attributes
henry KKK
 
Recruitment Management Systems
Recruitment Management SystemsRecruitment Management Systems
Recruitment Management Systems
MariaVyalkova
 

Viewers also liked (20)

Building android apps using xamarin
Building android apps using xamarinBuilding android apps using xamarin
Building android apps using xamarin
 
Xamarin mobile app portfolio tecordeon2
Xamarin mobile app portfolio   tecordeon2Xamarin mobile app portfolio   tecordeon2
Xamarin mobile app portfolio tecordeon2
 
SEMINAR ON Bluetooth Hotspot
SEMINAR ON Bluetooth HotspotSEMINAR ON Bluetooth Hotspot
SEMINAR ON Bluetooth Hotspot
 
Rotating magnetic field
Rotating magnetic fieldRotating magnetic field
Rotating magnetic field
 
Dave hay web sphere administration for domino administrators
Dave hay   web sphere administration for domino administratorsDave hay   web sphere administration for domino administrators
Dave hay web sphere administration for domino administrators
 
CV_Sbrodov Stanislav
CV_Sbrodov StanislavCV_Sbrodov Stanislav
CV_Sbrodov Stanislav
 
Net India123 Sept 22, 2008 - Markets fall sharply but begin recovery mid-afte...
Net India123 Sept 22, 2008 - Markets fall sharply but begin recovery mid-afte...Net India123 Sept 22, 2008 - Markets fall sharply but begin recovery mid-afte...
Net India123 Sept 22, 2008 - Markets fall sharply but begin recovery mid-afte...
 
Xamarin Navigation Patterns
Xamarin Navigation PatternsXamarin Navigation Patterns
Xamarin Navigation Patterns
 
Visual Studio Toolbox - Introduction To Xamarin.Forms
Visual Studio Toolbox - Introduction To Xamarin.FormsVisual Studio Toolbox - Introduction To Xamarin.Forms
Visual Studio Toolbox - Introduction To Xamarin.Forms
 
Examples of smart_objective_attributes
Examples of smart_objective_attributesExamples of smart_objective_attributes
Examples of smart_objective_attributes
 
Introduction to cross platform natitve mobile development with c# and xamarin
Introduction to cross platform natitve mobile development with c# and xamarinIntroduction to cross platform natitve mobile development with c# and xamarin
Introduction to cross platform natitve mobile development with c# and xamarin
 
Xamarin.Android + Arduino : Hacking Robots
Xamarin.Android + Arduino : Hacking RobotsXamarin.Android + Arduino : Hacking Robots
Xamarin.Android + Arduino : Hacking Robots
 
Resume objective example
Resume objective exampleResume objective example
Resume objective example
 
Lecture 08 Xamarin
Lecture 08 XamarinLecture 08 Xamarin
Lecture 08 Xamarin
 
Rajesh unni krishna resume
Rajesh unni krishna resumeRajesh unni krishna resume
Rajesh unni krishna resume
 
Extreme (Salesforce) Resume Makeover!
Extreme (Salesforce) Resume Makeover!Extreme (Salesforce) Resume Makeover!
Extreme (Salesforce) Resume Makeover!
 
Recruitment Management Systems
Recruitment Management SystemsRecruitment Management Systems
Recruitment Management Systems
 
Mobile Banking Apps with Xamarin
Mobile Banking Apps with XamarinMobile Banking Apps with Xamarin
Mobile Banking Apps with Xamarin
 
Building Your First Android App with Xamarin
Building Your First Android App with XamarinBuilding Your First Android App with Xamarin
Building Your First Android App with Xamarin
 
Intro to Xamarin for Visual Studio: Native iOS, Android, and Windows Apps in C#
Intro to Xamarin for Visual Studio: Native iOS, Android, and Windows Apps in C#Intro to Xamarin for Visual Studio: Native iOS, Android, and Windows Apps in C#
Intro to Xamarin for Visual Studio: Native iOS, Android, and Windows Apps in C#
 

Similar to Xamarin UI Test And Xamarin Test Cloud

Testing and Building Android
Testing and Building AndroidTesting and Building Android
Testing and Building Android
Droidcon Berlin
 
2012 java one-con3648
2012 java one-con36482012 java one-con3648
2012 java one-con3648
Eing Ong
 
Mobile Testing Challenges Lighting Talk with www.softtest.ie
Mobile Testing Challenges Lighting Talk with www.softtest.ieMobile Testing Challenges Lighting Talk with www.softtest.ie
Mobile Testing Challenges Lighting Talk with www.softtest.ie
David O'Dowd
 

Similar to Xamarin UI Test And Xamarin Test Cloud (20)

Getting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App TestingGetting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App Testing
 
Automation using Javascript
Automation using JavascriptAutomation using Javascript
Automation using Javascript
 
GDG DevFest Istanbul - Mobile DevOps - Build, Test and Deploy Your Android Ap...
GDG DevFest Istanbul - Mobile DevOps - Build, Test and Deploy Your Android Ap...GDG DevFest Istanbul - Mobile DevOps - Build, Test and Deploy Your Android Ap...
GDG DevFest Istanbul - Mobile DevOps - Build, Test and Deploy Your Android Ap...
 
Mobile testing. Xamarin.UITest approach
Mobile testing. Xamarin.UITest approachMobile testing. Xamarin.UITest approach
Mobile testing. Xamarin.UITest approach
 
XCUITest for iOS App Testing and how to test with Xcode
XCUITest for iOS App Testing and how to test with XcodeXCUITest for iOS App Testing and how to test with Xcode
XCUITest for iOS App Testing and how to test with Xcode
 
Testing and Building Android
Testing and Building AndroidTesting and Building Android
Testing and Building Android
 
2012 java one-con3648
2012 java one-con36482012 java one-con3648
2012 java one-con3648
 
Android Building, Testing and reversing
Android Building, Testing and reversingAndroid Building, Testing and reversing
Android Building, Testing and reversing
 
Introduction to Xamarin
Introduction to XamarinIntroduction to Xamarin
Introduction to Xamarin
 
Visual Studio 2017 Launch Event
Visual Studio 2017 Launch EventVisual Studio 2017 Launch Event
Visual Studio 2017 Launch Event
 
Mobile Testing Challenges Lighting Talk with www.softtest.ie
Mobile Testing Challenges Lighting Talk with www.softtest.ieMobile Testing Challenges Lighting Talk with www.softtest.ie
Mobile Testing Challenges Lighting Talk with www.softtest.ie
 
PUG Challenge 2016 - The nativescript pug app challenge
PUG Challenge 2016 -  The nativescript pug app challengePUG Challenge 2016 -  The nativescript pug app challenge
PUG Challenge 2016 - The nativescript pug app challenge
 
Xamarin v.Now
Xamarin v.NowXamarin v.Now
Xamarin v.Now
 
Selenium in the palm of your hand: Appium and automated mobile testing
Selenium in the palm of your hand: Appium and automated mobile testingSelenium in the palm of your hand: Appium and automated mobile testing
Selenium in the palm of your hand: Appium and automated mobile testing
 
Xamarin.UITest. From "Zero" to "Hero"
Xamarin.UITest. From "Zero" to "Hero"Xamarin.UITest. From "Zero" to "Hero"
Xamarin.UITest. From "Zero" to "Hero"
 
Appium Overview - by Daniel Puterman
Appium Overview - by Daniel PutermanAppium Overview - by Daniel Puterman
Appium Overview - by Daniel Puterman
 
Android 101 - Introduction to Android Development
Android 101 - Introduction to Android DevelopmentAndroid 101 - Introduction to Android Development
Android 101 - Introduction to Android Development
 
Automating Mobile Applications
Automating Mobile ApplicationsAutomating Mobile Applications
Automating Mobile Applications
 
AWS December 2015 Webinar Series - Continuous Delivery to Amazon EC2 Containe...
AWS December 2015 Webinar Series - Continuous Delivery to Amazon EC2 Containe...AWS December 2015 Webinar Series - Continuous Delivery to Amazon EC2 Containe...
AWS December 2015 Webinar Series - Continuous Delivery to Amazon EC2 Containe...
 
Xamarin Platform
Xamarin PlatformXamarin Platform
Xamarin Platform
 

Recently uploaded

If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
Kayode Fayemi
 
Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac Folorunso
Kayode Fayemi
 
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
amilabibi1
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
raffaeleoman
 

Recently uploaded (18)

Dreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIIDreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio III
 
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdfAWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
 
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
 
Dreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video TreatmentDreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video Treatment
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
 
Sector 62, Noida Call girls :8448380779 Noida Escorts | 100% verified
Sector 62, Noida Call girls :8448380779 Noida Escorts | 100% verifiedSector 62, Noida Call girls :8448380779 Noida Escorts | 100% verified
Sector 62, Noida Call girls :8448380779 Noida Escorts | 100% verified
 
My Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle BaileyMy Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle Bailey
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510
 
Causes of poverty in France presentation.pptx
Causes of poverty in France presentation.pptxCauses of poverty in France presentation.pptx
Causes of poverty in France presentation.pptx
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar Training
 
Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac Folorunso
 
lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.
 
ICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdfICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdf
 
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
 
Digital collaboration with Microsoft 365 as extension of Drupal
Digital collaboration with Microsoft 365 as extension of DrupalDigital collaboration with Microsoft 365 as extension of Drupal
Digital collaboration with Microsoft 365 as extension of Drupal
 
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfThe workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
 
Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...
Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...
Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...
 

Xamarin UI Test And Xamarin Test Cloud

  • 1. Xamarin UI Test And Xamarin Test Cloud Gavin Bryan (Freelance Certified Xamarin Developer)
  • 2. Overview • Xamarin UI Test • How and where Xamarin UI Tests can be run • Xamarin Test Cloud
  • 3. What is Xamarin UI Test? • Automation Test Library • Automate mobile device and application • Automated UI Acceptance Tests written in nunit (2.6.x) to be run against iOS and Android • Can be used on Xamarin Apps, iOS (objective-c / Swift Apps) and Native Android Apps • XTC does not support WP or Xamarin Forms WP
  • 4. Creating a Xamarin.UITest Project Xamarin Studio has 3 Project Templates 1. MultiPlatform
  • 5. Creating a Xamarin.UITest Project 2. IOS Template
  • 6. Creating a Xamarin.UITest Project 3. Android Template
  • 7. Most Simple Test • [Test] • public void MyFirstUITest() • { • var app = ConfigureApp • .Android • .ApkFile("MyApkFile.apk") • .StartApp(); • • app.EnterText("NameField", ”John Smith"); • app.Tap("SubmitButton"); • }
  • 8. UITest Anatomy • Uses a client / server communication using http and json. • Http server runs on the device • Communicates with UI Test Client Agent
  • 9.
  • 10. Android • Xamarin Test Cloud Agent Server runs in it’s own separate process • Process is signed with the same keystore as your application so it can drive it with the Android Automation APIs
  • 11. iOS • Due to iOS restrictions on iOS the Xamarin Test Cloud Agent has to be shipped with your app in the bundle • This allows it to access the iOS automation APIs • Xamarin Test Cloud Agent nuget needs to be installed
  • 12. Quick Example app.Tap (c => c.Marked (”New")); app.EnterText(c => c.Class("UITextField") .Index(0), ”John Smith"); app.Tap (c => c.Marked ("Save"));
  • 13. nUnit • Test Fixture • 3 A’s (Arrange / Act / Assert) • Categories • Demo – Create Android / IOS Project
  • 14. UI Test Workflow • Write automation tests while developing feature • Write tests, run locally to validate functionality • Create Test run to run in CI / XTC etc.
  • 15. UI Test Infrastructure • Tests rely heavily on queries to locate UI elements • Different techniques to share test logic between platforms • Your tests can be cross-platform if you write them in similar manner to cross-platform apps.
  • 16. Setting UI Elements • Need a way for UI Test to identify UI Elements • UI Test use different UI element ID on Android and iOS • Can you just text to identify element, but not a good practice.
  • 17. Android IDs • Generally your normal android:id tag is best identifier. • e.g. android:id="@+id/submitButton" • This is then used by UI Test • app.Tap (x => x.Id ("submitButton"))
  • 18. iOS Element IDs • UI Element Accessibility Identifier • UI Element Accessibility Label • Can set in XCode Identity Inspector or in Code
  • 19. Identifying UI Elements • REPL (read, eval, print, loop) • Android - Dump View Hierarchy for UI Automator • DEMO 1
  • 20. UI Test Basics • IApp – different implementations on Android and iOS • Use ConfigApp fluent builder to create implementation on each platform • Lots of methods and properties
  • 21. Xamarin Test Recorder • A tool for recording automated user interface tests. • Can be used on Android and iOS • Android runs as standalone app • iOS embeds a plugin into your app bundle to run (make this is removed on app submission) • Demo 2
  • 22. Where Can You Run Your Tests • Locally (devices or emulators / simulators) • CI environments (TeamCity, VSTS, VSMC, Jenkins, Bitrise etc.) • Xamarin Test Cloud (XTC)
  • 23. Command Line • Run locally :- nunit-console.exe in nuget package Nunit.Runners (2.6.4) • Send to Test Cloud :- • test-cloud.exe
  • 24. Find Device Ids • Android :- adb devices • iOS - xcrun instruments -s devices (ios get local devices) or Xcode • Demo 3
  • 25. Xamarin Test Cloud • Test your app on hundreds of actual devices in the Cloud (2000) • Select Subset of devices to test on • Very detailed analysis of your app • Upload APK, IPA with UI Test Project • iOS IPA are re-signed by Xamarin using their own provisioning profiles
  • 26. XTC • Xamarin resigns your iOS app with their provisioning profile so they can run on their devices.
  • 27. Some XTC Analysis • Screenshots • Memory Usage Profiling • CPU Usage • Test logs • Device logs • Demo 4
  • 28. Thank You • Any Questions ?

Editor's Notes

  1. Visual Studio has various project templates too
  2. Process is signed with the same keystore as your application so it can driver it with the Android Automation APIS
  3. https://developer.android.com/studio/profile/hierarchy-viewer.html
  4. https://developer.xamarin.com/api/namespace/Xamarin.UITest/
  5. https://testcloud.xamarin.com/devices