SlideShare a Scribd company logo
1 of 18
Download to read offline
iOS UI Testing in Xcode
Mark Chang

markchang@kkbox.com
Test Corner
About Me
• Mark Chang

• Testing Engineer in the KKBOX Inc.

• One of contributors in the “Testing with KK” blog.
Overview
• Record and Playback

• Test script (Swift or Objective-C)

• Running UI automation testing in iOS

• Code coverage and test reports
Demo 1

UI Recording - Record and Playback

YouTube Link
How does UI automation work ?
Locate the element
Operate the element
Verify the element
Example
Testing the Add button
// application:
let app = XCUIApplication()
app.launch()
// element and query:
let addButton = app.buttons[“Add”]
addButton.tap()
// assertion:
XCTAssertEqual(app.tables.cells.count, 1)
Example
Testing the Add button
// application:
let app = XCUIApplication()
app.launch()
// element and query:
let addButton = app.buttons[“Add”]
addButton.tap()
// assertion:
XCTAssertEqual(app.tables.cells.count, 1)
Example
Testing the Add button
// application:
let app = XCUIApplication()
app.launch()
// element and query:
let addButton = app.buttons[“Add”]
addButton.tap()
// assertion:
XCTAssertEqual(app.tables.cells.count, 1)
Example
Testing the Add button
// application:
let app = XCUIApplication()
app.launch()
// element and query:
let addButton = app.buttons[“Add”]
addButton.tap()
// assertion:
XCTAssertEqual(app.tables.cells.count, 1)
Example
// application:
let app = XCUIApplication()
app.launch()
// element and query:
let addButton = app.buttons[“Add”]
addButton.tap()
// assertion:
XCTAssertEqual(app.tables.cells.count, 1)
Testing the Add button
Example
// application:
let app = XCUIApplication()
app.launch()
// element and query:
let addButton = app.buttons[“Add”]
addButton.tap()
// assertion:
XCTAssertEqual(app.tables.cells.count, 1)
Testing the Add button
Example
// application:
let app = XCUIApplication()
app.launch()
// element and query:
let addButton = app.buttons[“Add”]
addButton.tap()
// assertion:
XCTAssertEqual(app.tables.cells.count, 1)
Testing the Add button
Example
// application:
let app = XCUIApplication()
app.launch()
// element and query:
let addButton = app.buttons[“Add”]
addButton.tap()
// assertion:
XCTAssertEqual(app.tables.cells.count, 1)
Testing the Add button
Example
Testing the Add button
// application:
let app = XCUIApplication()
app.launch()
// element and query:
let addButton = app.buttons[“Add”]
addButton.tap()
// assertion:
XCTAssertEqual(app.tables.cells.count, 1)
Demo 2

Code coverage and test reports

YouTube Link
For more information please visit
Any Questions ?
Reference
• 使⽤ Xcode 執⾏ UI ⾃動化測試 _ 科科和測試

• https://kkboxsqa.wordpress.com/2015/11/09/%E4%BD%BF%E7%94%A8-xcode-%E5%9F%B7%E8%A1%8C-ui-%E8%87%AA%E5%8B%95%E5%8C%96%E6%B8%AC%E8%A9%A6/

• 使⽤ Xcode Server 持續整合建置 _ 科科和測試

• https://kkboxsqa.wordpress.com/2015/12/10/xcode-server-continuous-integration/

• UI Testing in Xcode - WWDC 2015 - Videos - Apple Developer

• https://developer.apple.com/videos/play/wwdc2015-406/

• UI Testing in Xcode 7 · masilotti.com

• http://masilotti.com/ui-testing-xcode-7/

• Xcode 7 UI testing, a first look

• http://www.mokacoding.com/blog/xcode-7-ui-testing/

• How do I test this with UI Testing?

• https://github.com/joemasilotti/UI-Testing-Cheat-Sheet


More Related Content

What's hot

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 TestingBitbar
 
UI Testing with Earl Grey
UI Testing with Earl GreyUI Testing with Earl Grey
UI Testing with Earl GreyShyam Bhat
 
SwtBot: Unit Testing Made Easy
SwtBot: Unit Testing Made EasySwtBot: Unit Testing Made Easy
SwtBot: Unit Testing Made EasyAnkit Goel
 
[XCode] Automating UI Testing
[XCode] Automating UI Testing[XCode] Automating UI Testing
[XCode] Automating UI TestingPhineas Huang
 
Functional Testing made easy with SWTBot for Developers and Testers
Functional Testing made easy with SWTBot for Developers and TestersFunctional Testing made easy with SWTBot for Developers and Testers
Functional Testing made easy with SWTBot for Developers and TestersAurélien Pupier
 
Automating UI testing
Automating UI testingAutomating UI testing
Automating UI testingAdam Siton
 
Easy tests with Selenide and Easyb
Easy tests with Selenide and EasybEasy tests with Selenide and Easyb
Easy tests with Selenide and EasybIakiv Kramarenko
 
Writing and Testing JavaScript-heavy Web 2.0 apps with JSUnit
Writing and Testing JavaScript-heavy Web 2.0 apps with JSUnitWriting and Testing JavaScript-heavy Web 2.0 apps with JSUnit
Writing and Testing JavaScript-heavy Web 2.0 apps with JSUnitAlex Chaffee
 
Mobile Developers Talks: Delve Mobile
Mobile Developers Talks: Delve MobileMobile Developers Talks: Delve Mobile
Mobile Developers Talks: Delve MobileKonstantin Loginov
 
Mobile Worshop Lab guide
Mobile Worshop Lab guideMobile Worshop Lab guide
Mobile Worshop Lab guideMan Chan
 
Secret unit testing tools
Secret unit testing toolsSecret unit testing tools
Secret unit testing toolsDror Helper
 
Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016
Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016
Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016Codemotion
 
Android UI Testing with Espresso
Android UI Testing with EspressoAndroid UI Testing with Espresso
Android UI Testing with EspressoGary Cheng
 

What's hot (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
 
UI Testing with Earl Grey
UI Testing with Earl GreyUI Testing with Earl Grey
UI Testing with Earl Grey
 
Xcode7 UI Automation
Xcode7 UI AutomationXcode7 UI Automation
Xcode7 UI Automation
 
SwtBot: Unit Testing Made Easy
SwtBot: Unit Testing Made EasySwtBot: Unit Testing Made Easy
SwtBot: Unit Testing Made Easy
 
SWTBot Tutorial
SWTBot TutorialSWTBot Tutorial
SWTBot Tutorial
 
[XCode] Automating UI Testing
[XCode] Automating UI Testing[XCode] Automating UI Testing
[XCode] Automating UI Testing
 
Swtbot
SwtbotSwtbot
Swtbot
 
Functional Testing made easy with SWTBot for Developers and Testers
Functional Testing made easy with SWTBot for Developers and TestersFunctional Testing made easy with SWTBot for Developers and Testers
Functional Testing made easy with SWTBot for Developers and Testers
 
UI testing in Xcode 7
UI testing in Xcode 7UI testing in Xcode 7
UI testing in Xcode 7
 
Automating UI testing
Automating UI testingAutomating UI testing
Automating UI testing
 
Easy tests with Selenide and Easyb
Easy tests with Selenide and EasybEasy tests with Selenide and Easyb
Easy tests with Selenide and Easyb
 
JsUnit
JsUnitJsUnit
JsUnit
 
Writing and Testing JavaScript-heavy Web 2.0 apps with JSUnit
Writing and Testing JavaScript-heavy Web 2.0 apps with JSUnitWriting and Testing JavaScript-heavy Web 2.0 apps with JSUnit
Writing and Testing JavaScript-heavy Web 2.0 apps with JSUnit
 
Mobile Developers Talks: Delve Mobile
Mobile Developers Talks: Delve MobileMobile Developers Talks: Delve Mobile
Mobile Developers Talks: Delve Mobile
 
Mobile Worshop Lab guide
Mobile Worshop Lab guideMobile Worshop Lab guide
Mobile Worshop Lab guide
 
Active x
Active xActive x
Active x
 
Secret unit testing tools
Secret unit testing toolsSecret unit testing tools
Secret unit testing tools
 
Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016
Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016
Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016
 
Android UI Testing with Espresso
Android UI Testing with EspressoAndroid UI Testing with Espresso
Android UI Testing with Espresso
 
iOS UI Automation
iOS UI AutomationiOS UI Automation
iOS UI Automation
 

Viewers also liked

Page Object in XCUITest
Page Object in XCUITestPage Object in XCUITest
Page Object in XCUITestJz Chang
 
iOS Test-Driven Development
iOS Test-Driven DevelopmentiOS Test-Driven Development
iOS Test-Driven DevelopmentPablo Villar
 
Advanced Project 1: Heart Bleed
Advanced Project 1: Heart BleedAdvanced Project 1: Heart Bleed
Advanced Project 1: Heart BleedKenneth Poon
 
PropertyGuru is Hiring. iOS / Android Engineer (Bangkok, Thailand)
PropertyGuru is Hiring. iOS / Android Engineer (Bangkok, Thailand)PropertyGuru is Hiring. iOS / Android Engineer (Bangkok, Thailand)
PropertyGuru is Hiring. iOS / Android Engineer (Bangkok, Thailand)Kenneth Poon
 
Sunrise pc support heart bleed scam alert
Sunrise pc support heart bleed scam alertSunrise pc support heart bleed scam alert
Sunrise pc support heart bleed scam alertjimforner
 
CNY Distribution of Oranges, Uplifting the spirit [@TPCTMC]
CNY Distribution of Oranges, Uplifting the spirit [@TPCTMC]CNY Distribution of Oranges, Uplifting the spirit [@TPCTMC]
CNY Distribution of Oranges, Uplifting the spirit [@TPCTMC]Kenneth Poon
 

Viewers also liked (6)

Page Object in XCUITest
Page Object in XCUITestPage Object in XCUITest
Page Object in XCUITest
 
iOS Test-Driven Development
iOS Test-Driven DevelopmentiOS Test-Driven Development
iOS Test-Driven Development
 
Advanced Project 1: Heart Bleed
Advanced Project 1: Heart BleedAdvanced Project 1: Heart Bleed
Advanced Project 1: Heart Bleed
 
PropertyGuru is Hiring. iOS / Android Engineer (Bangkok, Thailand)
PropertyGuru is Hiring. iOS / Android Engineer (Bangkok, Thailand)PropertyGuru is Hiring. iOS / Android Engineer (Bangkok, Thailand)
PropertyGuru is Hiring. iOS / Android Engineer (Bangkok, Thailand)
 
Sunrise pc support heart bleed scam alert
Sunrise pc support heart bleed scam alertSunrise pc support heart bleed scam alert
Sunrise pc support heart bleed scam alert
 
CNY Distribution of Oranges, Uplifting the spirit [@TPCTMC]
CNY Distribution of Oranges, Uplifting the spirit [@TPCTMC]CNY Distribution of Oranges, Uplifting the spirit [@TPCTMC]
CNY Distribution of Oranges, Uplifting the spirit [@TPCTMC]
 

Similar to iOS UI Testing in Xcode

Acceptance Testing With Selenium
Acceptance Testing With SeleniumAcceptance Testing With Selenium
Acceptance Testing With Seleniumelliando dias
 
Qtp 92 Tutorial769
Qtp 92 Tutorial769Qtp 92 Tutorial769
Qtp 92 Tutorial769subhasis100
 
qtp 9.2 features
qtp 9.2 featuresqtp 9.2 features
qtp 9.2 featureskrishna3032
 
Qtp 92 Tutorial
Qtp 92 TutorialQtp 92 Tutorial
Qtp 92 Tutorialsasidhar
 
Qtp 92 Tutorial769
Qtp 92 Tutorial769Qtp 92 Tutorial769
Qtp 92 Tutorial769subhasis100
 
Qtp 92 Tutorial Anil
Qtp 92 Tutorial AnilQtp 92 Tutorial Anil
Qtp 92 Tutorial Anilguest3373d3
 
Qtp 9.2 Tutorial
Qtp 9.2 TutorialQtp 9.2 Tutorial
Qtp 9.2 Tutorialguest37ae7f
 
Espresso workshop
Espresso workshopEspresso workshop
Espresso workshopKetan Soni
 
UI Testing with Spec
 UI Testing with Spec UI Testing with Spec
UI Testing with SpecPharo
 
How to Use Material UI Tooltip Component Like a Pro
How to Use Material UI Tooltip Component Like a ProHow to Use Material UI Tooltip Component Like a Pro
How to Use Material UI Tooltip Component Like a ProRonDosh
 
SoapUI Pro Plugin Workshop #SoapUIPlugins
SoapUI Pro Plugin Workshop #SoapUIPluginsSoapUI Pro Plugin Workshop #SoapUIPlugins
SoapUI Pro Plugin Workshop #SoapUIPluginsSmartBear
 
Eclipse Summit Europe '10 - Test UI Aspects of Plug-ins
Eclipse Summit Europe '10 - Test UI Aspects of Plug-insEclipse Summit Europe '10 - Test UI Aspects of Plug-ins
Eclipse Summit Europe '10 - Test UI Aspects of Plug-insTonny Madsen
 
Lightning Components Workshop
Lightning Components WorkshopLightning Components Workshop
Lightning Components WorkshopGordon Bockus
 
Testing view controllers with Quick and Nimble
Testing view controllers with Quick and NimbleTesting view controllers with Quick and Nimble
Testing view controllers with Quick and NimbleMarcio Klepacz
 

Similar to iOS UI Testing in Xcode (20)

Acceptance Testing With Selenium
Acceptance Testing With SeleniumAcceptance Testing With Selenium
Acceptance Testing With Selenium
 
UIAutomator
UIAutomatorUIAutomator
UIAutomator
 
Qtp 92 Tutorial769
Qtp 92 Tutorial769Qtp 92 Tutorial769
Qtp 92 Tutorial769
 
qtp 9.2 features
qtp 9.2 featuresqtp 9.2 features
qtp 9.2 features
 
Qtp 92 Tutorial
Qtp 92 TutorialQtp 92 Tutorial
Qtp 92 Tutorial
 
Ppt Qtp
Ppt QtpPpt Qtp
Ppt Qtp
 
Qtp 92 Tutorial769
Qtp 92 Tutorial769Qtp 92 Tutorial769
Qtp 92 Tutorial769
 
Qtp 92 Tutorial Anil
Qtp 92 Tutorial AnilQtp 92 Tutorial Anil
Qtp 92 Tutorial Anil
 
Qtp 9.2 Tutorial
Qtp 9.2 TutorialQtp 9.2 Tutorial
Qtp 9.2 Tutorial
 
Qtp 92 Tutorial769
Qtp 92 Tutorial769Qtp 92 Tutorial769
Qtp 92 Tutorial769
 
Test Complete
Test CompleteTest Complete
Test Complete
 
Qtp day 3
Qtp day 3Qtp day 3
Qtp day 3
 
Lightning Components Workshop
Lightning Components WorkshopLightning Components Workshop
Lightning Components Workshop
 
Espresso workshop
Espresso workshopEspresso workshop
Espresso workshop
 
UI Testing with Spec
 UI Testing with Spec UI Testing with Spec
UI Testing with Spec
 
How to Use Material UI Tooltip Component Like a Pro
How to Use Material UI Tooltip Component Like a ProHow to Use Material UI Tooltip Component Like a Pro
How to Use Material UI Tooltip Component Like a Pro
 
SoapUI Pro Plugin Workshop #SoapUIPlugins
SoapUI Pro Plugin Workshop #SoapUIPluginsSoapUI Pro Plugin Workshop #SoapUIPlugins
SoapUI Pro Plugin Workshop #SoapUIPlugins
 
Eclipse Summit Europe '10 - Test UI Aspects of Plug-ins
Eclipse Summit Europe '10 - Test UI Aspects of Plug-insEclipse Summit Europe '10 - Test UI Aspects of Plug-ins
Eclipse Summit Europe '10 - Test UI Aspects of Plug-ins
 
Lightning Components Workshop
Lightning Components WorkshopLightning Components Workshop
Lightning Components Workshop
 
Testing view controllers with Quick and Nimble
Testing view controllers with Quick and NimbleTesting view controllers with Quick and Nimble
Testing view controllers with Quick and Nimble
 

Recently uploaded

英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 

Recently uploaded (20)

英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 

iOS UI Testing in Xcode

  • 1. iOS UI Testing in Xcode Mark Chang markchang@kkbox.com Test Corner
  • 2. About Me • Mark Chang • Testing Engineer in the KKBOX Inc. • One of contributors in the “Testing with KK” blog.
  • 3. Overview • Record and Playback • Test script (Swift or Objective-C) • Running UI automation testing in iOS • Code coverage and test reports
  • 4. Demo 1 UI Recording - Record and Playback YouTube Link
  • 5. How does UI automation work ?
  • 6. Locate the element Operate the element Verify the element
  • 7. Example Testing the Add button // application: let app = XCUIApplication() app.launch() // element and query: let addButton = app.buttons[“Add”] addButton.tap() // assertion: XCTAssertEqual(app.tables.cells.count, 1)
  • 8. Example Testing the Add button // application: let app = XCUIApplication() app.launch() // element and query: let addButton = app.buttons[“Add”] addButton.tap() // assertion: XCTAssertEqual(app.tables.cells.count, 1)
  • 9. Example Testing the Add button // application: let app = XCUIApplication() app.launch() // element and query: let addButton = app.buttons[“Add”] addButton.tap() // assertion: XCTAssertEqual(app.tables.cells.count, 1)
  • 10. Example Testing the Add button // application: let app = XCUIApplication() app.launch() // element and query: let addButton = app.buttons[“Add”] addButton.tap() // assertion: XCTAssertEqual(app.tables.cells.count, 1)
  • 11. Example // application: let app = XCUIApplication() app.launch() // element and query: let addButton = app.buttons[“Add”] addButton.tap() // assertion: XCTAssertEqual(app.tables.cells.count, 1) Testing the Add button
  • 12. Example // application: let app = XCUIApplication() app.launch() // element and query: let addButton = app.buttons[“Add”] addButton.tap() // assertion: XCTAssertEqual(app.tables.cells.count, 1) Testing the Add button
  • 13. Example // application: let app = XCUIApplication() app.launch() // element and query: let addButton = app.buttons[“Add”] addButton.tap() // assertion: XCTAssertEqual(app.tables.cells.count, 1) Testing the Add button
  • 14. Example // application: let app = XCUIApplication() app.launch() // element and query: let addButton = app.buttons[“Add”] addButton.tap() // assertion: XCTAssertEqual(app.tables.cells.count, 1) Testing the Add button
  • 15. Example Testing the Add button // application: let app = XCUIApplication() app.launch() // element and query: let addButton = app.buttons[“Add”] addButton.tap() // assertion: XCTAssertEqual(app.tables.cells.count, 1)
  • 16. Demo 2 Code coverage and test reports YouTube Link
  • 17. For more information please visit Any Questions ?
  • 18. Reference • 使⽤ Xcode 執⾏ UI ⾃動化測試 _ 科科和測試 • https://kkboxsqa.wordpress.com/2015/11/09/%E4%BD%BF%E7%94%A8-xcode-%E5%9F%B7%E8%A1%8C-ui-%E8%87%AA%E5%8B%95%E5%8C%96%E6%B8%AC%E8%A9%A6/ • 使⽤ Xcode Server 持續整合建置 _ 科科和測試 • https://kkboxsqa.wordpress.com/2015/12/10/xcode-server-continuous-integration/ • UI Testing in Xcode - WWDC 2015 - Videos - Apple Developer • https://developer.apple.com/videos/play/wwdc2015-406/ • UI Testing in Xcode 7 · masilotti.com • http://masilotti.com/ui-testing-xcode-7/ • Xcode 7 UI testing, a first look • http://www.mokacoding.com/blog/xcode-7-ui-testing/ • How do I test this with UI Testing? • https://github.com/joemasilotti/UI-Testing-Cheat-Sheet