SlideShare una empresa de Scribd logo
1 de 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 ?

Más contenido relacionado

La actualidad más candente

La actualidad más candente (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#
 

Destacado

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
 

Destacado (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 a 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 a 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
 

Último

Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven CuriosityUnlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Hung Le
 
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
David Celestin
 

Último (20)

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 Concession of Asaba International Airport: Balancing Politics and Policy ...
The Concession of Asaba International Airport: Balancing Politics and Policy ...The Concession of Asaba International Airport: Balancing Politics and Policy ...
The Concession of Asaba International Airport: Balancing Politics and Policy ...
 
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven CuriosityUnlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
 
in kuwait௹+918133066128....) @abortion pills for sale in Kuwait City
in kuwait௹+918133066128....) @abortion pills for sale in Kuwait Cityin kuwait௹+918133066128....) @abortion pills for sale in Kuwait City
in kuwait௹+918133066128....) @abortion pills for sale in Kuwait City
 
Databricks Machine Learning Associate Exam Dumps 2024.pdf
Databricks Machine Learning Associate Exam Dumps 2024.pdfDatabricks Machine Learning Associate Exam Dumps 2024.pdf
Databricks Machine Learning Associate Exam Dumps 2024.pdf
 
2024 mega trends for the digital workplace - FINAL.pdf
2024 mega trends for the digital workplace - FINAL.pdf2024 mega trends for the digital workplace - FINAL.pdf
2024 mega trends for the digital workplace - FINAL.pdf
 
BEAUTIFUL PLACES TO VISIT IN LESOTHO.pptx
BEAUTIFUL PLACES TO VISIT IN LESOTHO.pptxBEAUTIFUL PLACES TO VISIT IN LESOTHO.pptx
BEAUTIFUL PLACES TO VISIT IN LESOTHO.pptx
 
Abortion Pills Fahaheel ௹+918133066128💬@ Safe and Effective Mifepristion and ...
Abortion Pills Fahaheel ௹+918133066128💬@ Safe and Effective Mifepristion and ...Abortion Pills Fahaheel ௹+918133066128💬@ Safe and Effective Mifepristion and ...
Abortion Pills Fahaheel ௹+918133066128💬@ Safe and Effective Mifepristion and ...
 
BIG DEVELOPMENTS IN LESOTHO(DAMS & MINES
BIG DEVELOPMENTS IN LESOTHO(DAMS & MINESBIG DEVELOPMENTS IN LESOTHO(DAMS & MINES
BIG DEVELOPMENTS IN LESOTHO(DAMS & MINES
 
Using AI to boost productivity for developers
Using AI to boost productivity for developersUsing AI to boost productivity for developers
Using AI to boost productivity for developers
 
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdf
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdfSOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdf
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdf
 
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
 
BIG DEVELOPMENTS IN LESOTHO(DAMS & MINES
BIG DEVELOPMENTS IN LESOTHO(DAMS & MINESBIG DEVELOPMENTS IN LESOTHO(DAMS & MINES
BIG DEVELOPMENTS IN LESOTHO(DAMS & MINES
 
History of Morena Moshoeshoe birth death
History of Morena Moshoeshoe birth deathHistory of Morena Moshoeshoe birth death
History of Morena Moshoeshoe birth death
 
2024-05-15-Surat Meetup-Hyperautomation.pptx
2024-05-15-Surat Meetup-Hyperautomation.pptx2024-05-15-Surat Meetup-Hyperautomation.pptx
2024-05-15-Surat Meetup-Hyperautomation.pptx
 
"I hear you": Moving beyond empathy in UXR
"I hear you": Moving beyond empathy in UXR"I hear you": Moving beyond empathy in UXR
"I hear you": Moving beyond empathy in UXR
 
STM valmiusseminaari 26-04-2024 PUUMALAINEN Ajankohtaista kansainvälisestä yh...
STM valmiusseminaari 26-04-2024 PUUMALAINEN Ajankohtaista kansainvälisestä yh...STM valmiusseminaari 26-04-2024 PUUMALAINEN Ajankohtaista kansainvälisestä yh...
STM valmiusseminaari 26-04-2024 PUUMALAINEN Ajankohtaista kansainvälisestä yh...
 
SaaStr Workshop Wednesday with CEO of Guru
SaaStr Workshop Wednesday with CEO of GuruSaaStr Workshop Wednesday with CEO of Guru
SaaStr Workshop Wednesday with CEO of Guru
 
LITTLE ABOUT LESOTHO FROM THE TIME MOSHOESHOE THE FIRST WAS BORN
LITTLE ABOUT LESOTHO FROM THE TIME MOSHOESHOE THE FIRST WAS BORNLITTLE ABOUT LESOTHO FROM THE TIME MOSHOESHOE THE FIRST WAS BORN
LITTLE ABOUT LESOTHO FROM THE TIME MOSHOESHOE THE FIRST WAS BORN
 
SaaStr Workshop Wednesdays - RevenueCat.pdf
SaaStr Workshop Wednesdays - RevenueCat.pdfSaaStr Workshop Wednesdays - RevenueCat.pdf
SaaStr Workshop Wednesdays - RevenueCat.pdf
 

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 ?

Notas del editor

  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