SlideShare a Scribd company logo
1 of 35
High Sierra
Selenium-based Testing
Validation, Workflow, Zalenium, Azure
Part 1 of 3 Copyright © 2019 David Harrison
Part 1 – Validation, Zalenium
Context
01
02
03
04
We are predominantly testing
Assert-Assert-Assert is the basic mantra of Test Automation
Sometimes we simulate something
Maybe we want to generate special data…etc.
We are members of a project
Whether Waterfall or Agile, we are participants
We are developing business value
We construct & deliver something of value to the project
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
The Story
What will be covered in this presentation
Validation is KING.
This is the bedrock of what we do in
Test Automation, as in any testing
Validation
When we have a mid- to large-
volume of tests, using a scalable
execution platform is something to
be considered
Zalenium
01
03 04
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
The
Target
Application
This web site provides an elegant, and challenging, platform for Test Automation
approaches to be developed:
Site: http://automationpractice.com/index.php
Its key themes are:
• Account creation
• Login for account holders
• Shopping for items in a store
• Search for items in store
• Shopping Cart
• Check out
• Delivery information
• Logout
• Strip Page site
Target Application
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
The
Approach
The approach showcased in this series, has the following characteristics:
• Validation: Unit Tests C#-based (https://docs.microsoft.com/en-
us/dotnet/core/testing/)
• Selenium-based tests (https://www.seleniumhq.org/)
• Workflow: Specflow-based (https://specflow.org/)
• Zalenium: (http://opensource.zalando.com/zalenium/)
• Azure Cloud: (https://docs.microsoft.com/en-
us/azure/devops/pipelines/test/continuous-test-selenium?view=azure-devops)
Approach
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
• Shop product groups
• Shop tabs
• Shop items have overlay @ hover
• Shop items have “Quick view” link on
hover
• Items have offers/reductions
Key Points
What are the important aspects of the app? The application is built using Ajax so we need to be
very aware of “waiting” for elements.
Ajax
Validating items in the storefront involves dealing
with multiple pages and overlays/offers/reductions
etc.
Storefront
Some of the Footer elements (in principle) declare
the legal basis for using the shopping site. We need
to validate the legal text.
Legal
01
02
03
A key element of this site is the state of the
Shopping Cart. This we need to validate.
Shopping Cart
04
Validating the correctness of key business
workflows is crucial to the testing of this site.
Business Workflow
05
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
Validation
What do we validate? We validate that some key page elements exist.
Existence
We validate that some key items are visible when
they are expected to be.
Visibility
We validate that the strip page can be moved and
that certain elements become visible/(not visible).
Movement
01
02
03
Validate that the store items on the Main page
display the appropriate data.
Storefront
04
Validate that the page footer shows the appropriate
important links – and that they show the correct
data (legal text).
Page Footer
05
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
Key Points
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
• We use a test properties object to manage generic and test-specific propertie
s
• We use Log4Net as our logging infrastructure
• We use of certain frameworks such as “DotNetSelenium.Extras.WaitHelpers”
to provide element wait functionality
• The Page Objects are generated by Se34 (https://www.dharrisonch.com/)
• For certain “special” operations we will use Selenium WebDriver JavaScript
(because of app “features”)
• For this example we use C#/.Net but we could equally as well be using Java
• We use the Chrome browser
Generating Page Objects
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
• Metadata describing “pages” (validations,
operations etc)
• Se34 used to generate fully finished Page
Object Classes (C#/Java)
• App change -> update ->re-generate
Generating Page Properties
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
• Se34 used to generate Property files
(optional)
• App change -> update ->re-generate
• Dynamic (run-time) values can be dealt with
using an Oracle (“xx = ?”)
UT - Assembly Initialization
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
• Adding test properties
• Set up Log4Net
UT - Test Class Instantiation
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
• Set up test base class
• Set up the site form
• Initialise the validation bit mask
• Initialise browser
• Initialise the shop data
• Initialise the error bit mask
UT - Test Initialization
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
• This is executed per unit test!
• Are we executing local tests?
• Configure WebDriver
• Maximise the browser window
• Set the implicit wait interval
• Instantiate the MainPage
• Navigate to it
• Wait for it
Initialise UT-Specific Properties
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
UT - Test Cleanup
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
Quit the driver – we renew the driver for each test
UT - Validate Existence
• Check that this UT can
run (local, remote etc)
• Note fluent validation
statement
• Check if errors detected
• Just a selection of
possibilities
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
UT - Validate Visibility
• Check that this UT can
run (local, remote etc)
• Use base class methods
to check for visibility
• Use base class methods
to move to bottom of strip
page
• Just a selection of
possibilities
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
UT - Validate Movement
• Check visibilities of elements
when scrolling the page
• Using base class methods to
scroll strip page
• Using base class methods to
check for visibility
• Just a selection of
possibilities
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
UT - Validate Storefront (1)
• Validate items for each type of storefront
• Select Store Tab and use local test
method to do the heavy lifting
• Log & Assert
• Just a selection of possibilities
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
UT - Validate Storefront (2)
• Local method that performs Asserts
• Need to manage physical cursor because of
item overlay
• Loop over items in the configured shop
data
• Need to take care of item overlay (frame)
(move physical cursor by small amount)
• Build the image, and other XPath
expressions
• Configure a local wait object
• We cant configure the XPath expressions
for all the elements of an item, they depend
on whether the item has a reduction
(dynamic)
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
UT - Validate Storefront (3)
• Check the existence of the various
pieces of the displayed item data
• Make us of the test properties to
get data
• Move physical cursor if the item
data suggests a reduction (remove
overlay)
• Validate Price/Old Price/Reduction
as required
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
UT - Validate Storefront (4)
• Build the XPath expressions for
the various parts of the
dynamic elements
• Check existence & value
(against configured test data)
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
Validate Storefront (5)
• Validate the item Price
• Click on the image (NOT Quick
View link)
• Instantiate ItemDetailPage
• Validate ItemDetailPage (local
method)
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
Validate Storefront (6)
• Validate existence of elements on ItemDetailsPage
• Validation of values – left for interested reader
(see Page Object)
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
Validate Login (1)
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
• Validate Account login (local
method)
• Instantiate Account Page
• Validate content existence
• Validation of values – left for the
interested reader
Validate Login (2)
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
• Local method that does Asserts (assumes valid
credentials)
• Click the Sign-In “label” on the Main Page
• Instantiate Sign-In/(Account Creation) Page
• Validate content existence
• Values – left for interested reader (see Page
Object)
• Enter the email specified by parameter
• Enter the password specified by parameter
• Click the Sign-In button
• Instantiate the Account Page
• Wait for the Account Page to appear
• Existence & Values – left for interested reader
(see Page Object)
Results
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
• Execution in VS Test Explorer
• We don’t execute “create account” tests as no
means to remove created accounts
Zalenium Test Execution
• Undefine runtime param
in UT code
• -> leads to Config of
RemoteWebDriver
(base class method call)
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
Zalenium Test Execution
• Batch files (execute in cmd.exe):
• Pull down the most recent images
• Start Zalenium via Docker
• There are a range of configuration parameters that
can be used when starting Zalenium
(see: https://opensource.zalando.com/zalenium/)
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
Zalenium Test Output
• Example execution: Account Page
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
Summary
Where are we?
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
Key Points
Below are the main points to be borne in mind about test automation
The code we produce should reflect development
practice – not the outcome of cooking Spaghetti!
It’s Development
The focus of what we do should be establishing
“correctness” of the application in the context of
each test.
It’s Testing
The tests we write must execute routinely attributes
– particularly when we go to a DevOps pipeline.
It’s Reliable
01
02
03
Tests must meet up to these key attributes –
particularly when we go to a DevOps pipeline.
It’s Maintainable, Accessible, Scalable
04
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
This slide pack has covered the basic Selenium-based testing validation for a
specific web application, a shopping site. Some of the detail, such as ensuring the
values of things on the individual pages, has been “left to the interested reader”,
as they say. All the methods to do this are available in the individual Page Objects.
We have looked at a subset of testing targets for this site, but in doing so we have
arrived at a scalable testing approach which can be readily expanded.
The use of generated Page Object classes is a key take-away of this presentation.
If, as test automation practitioners, we want to be players in the Agile project story,
then what we do must be “sprintable” - able to be broken down, confidently, into
Stories. The generation of finished Page Objects is key to achieving this worthy
goal.
Two themes when using Selenium:
• Perform exploratory testing on the app to understand how it fits together
• Be prepared to wait for pages and elements (and sometimes element content)
in your test code
This slide pack is one in a series related to Selenium-based test automation.
Summary
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
Thank you
All views…All voices…All welcome
https://www.linkedin.com/in/david-harrison-2952187/
© 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/

More Related Content

Similar to High sierra part 1

AWS Initiate Day Dublin 2019 – Moving to DevOps the Amazon Way
AWS Initiate Day Dublin 2019 – Moving to DevOps the Amazon WayAWS Initiate Day Dublin 2019 – Moving to DevOps the Amazon Way
AWS Initiate Day Dublin 2019 – Moving to DevOps the Amazon WayAmazon Web Services
 
Developing Offline Mobile Apps with Salesforce Mobile SDK SmartStore
Developing Offline Mobile Apps with Salesforce Mobile SDK SmartStoreDeveloping Offline Mobile Apps with Salesforce Mobile SDK SmartStore
Developing Offline Mobile Apps with Salesforce Mobile SDK SmartStoreTom Gersic
 
Operational Excellence for Identity & Access Management (SEC334) - AWS re:Inv...
Operational Excellence for Identity & Access Management (SEC334) - AWS re:Inv...Operational Excellence for Identity & Access Management (SEC334) - AWS re:Inv...
Operational Excellence for Identity & Access Management (SEC334) - AWS re:Inv...Amazon Web Services
 
Staying Ahead of the Curve with Lightning - Snowforce16 Keynote
Staying Ahead of the Curve with Lightning - Snowforce16 KeynoteStaying Ahead of the Curve with Lightning - Snowforce16 Keynote
Staying Ahead of the Curve with Lightning - Snowforce16 KeynoteSalesforce Admins
 
Assessing your Application Portfolio (ENT202-R2) - AWS re:Invent 2018
Assessing your Application Portfolio (ENT202-R2) - AWS re:Invent 2018Assessing your Application Portfolio (ENT202-R2) - AWS re:Invent 2018
Assessing your Application Portfolio (ENT202-R2) - AWS re:Invent 2018Amazon Web Services
 
Wix to Shopify migration checklist.pdf
Wix to Shopify migration checklist.pdfWix to Shopify migration checklist.pdf
Wix to Shopify migration checklist.pdfCart2Cart2
 
Quickly Create Data Sets for the Analytics Cloud
Quickly Create Data Sets for the Analytics CloudQuickly Create Data Sets for the Analytics Cloud
Quickly Create Data Sets for the Analytics CloudSalesforce Developers
 
Presentation Maintenance Cloud.pdf
Presentation Maintenance Cloud.pdfPresentation Maintenance Cloud.pdf
Presentation Maintenance Cloud.pdfWalidShoman3
 
Nirav Kothari: Well-Architected - Operational Excellence Instructor Led Lab.pdf
Nirav Kothari: Well-Architected - Operational Excellence Instructor Led Lab.pdfNirav Kothari: Well-Architected - Operational Excellence Instructor Led Lab.pdf
Nirav Kothari: Well-Architected - Operational Excellence Instructor Led Lab.pdfAmazon Web Services
 
Building IoT Devices for Regulated Industries (LFS304-i) - AWS re:Invent 2018
Building IoT Devices for Regulated Industries (LFS304-i) - AWS re:Invent 2018Building IoT Devices for Regulated Industries (LFS304-i) - AWS re:Invent 2018
Building IoT Devices for Regulated Industries (LFS304-i) - AWS re:Invent 2018Amazon Web Services
 
Initiate Edinburgh 2019 - Moving to DevOps the Amazon Way
Initiate Edinburgh 2019 - Moving to DevOps the Amazon WayInitiate Edinburgh 2019 - Moving to DevOps the Amazon Way
Initiate Edinburgh 2019 - Moving to DevOps the Amazon WayAmazon Web Services
 
Developing a Documentation Portal on Heroku
Developing a Documentation Portal on HerokuDeveloping a Documentation Portal on Heroku
Developing a Documentation Portal on HerokuSalesforce Developers
 
Planning Your Migration to the Lightning Experience
Planning Your Migration to the Lightning ExperiencePlanning Your Migration to the Lightning Experience
Planning Your Migration to the Lightning ExperienceShell Black
 
Taking Identity from the Enterprise to the Cloud
Taking Identity from the Enterprise to the CloudTaking Identity from the Enterprise to the Cloud
Taking Identity from the Enterprise to the CloudPat Patterson
 
Drive Self-Service & Standardization in the First 100 Days of Your Cloud Migr...
Drive Self-Service & Standardization in the First 100 Days of Your Cloud Migr...Drive Self-Service & Standardization in the First 100 Days of Your Cloud Migr...
Drive Self-Service & Standardization in the First 100 Days of Your Cloud Migr...Amazon Web Services
 
Visualforce Hack for Junction Objects
Visualforce Hack for Junction ObjectsVisualforce Hack for Junction Objects
Visualforce Hack for Junction ObjectsRitesh Aswaney
 
打造新一代的企業 IT - Transforming Enterprise IT
打造新一代的企業 IT - Transforming Enterprise IT打造新一代的企業 IT - Transforming Enterprise IT
打造新一代的企業 IT - Transforming Enterprise ITAmazon Web Services
 
Developing Offline-Capable Apps with the Salesforce Mobile SDK and SmartStore
Developing Offline-Capable Apps with the Salesforce Mobile SDK and SmartStoreDeveloping Offline-Capable Apps with the Salesforce Mobile SDK and SmartStore
Developing Offline-Capable Apps with the Salesforce Mobile SDK and SmartStoreSalesforce Developers
 

Similar to High sierra part 1 (20)

AWS Initiate Day Dublin 2019 – Moving to DevOps the Amazon Way
AWS Initiate Day Dublin 2019 – Moving to DevOps the Amazon WayAWS Initiate Day Dublin 2019 – Moving to DevOps the Amazon Way
AWS Initiate Day Dublin 2019 – Moving to DevOps the Amazon Way
 
Developing Offline Mobile Apps with Salesforce Mobile SDK SmartStore
Developing Offline Mobile Apps with Salesforce Mobile SDK SmartStoreDeveloping Offline Mobile Apps with Salesforce Mobile SDK SmartStore
Developing Offline Mobile Apps with Salesforce Mobile SDK SmartStore
 
Operational Excellence for Identity & Access Management (SEC334) - AWS re:Inv...
Operational Excellence for Identity & Access Management (SEC334) - AWS re:Inv...Operational Excellence for Identity & Access Management (SEC334) - AWS re:Inv...
Operational Excellence for Identity & Access Management (SEC334) - AWS re:Inv...
 
Staying Ahead of the Curve with Lightning - Snowforce16 Keynote
Staying Ahead of the Curve with Lightning - Snowforce16 KeynoteStaying Ahead of the Curve with Lightning - Snowforce16 Keynote
Staying Ahead of the Curve with Lightning - Snowforce16 Keynote
 
Assessing your Application Portfolio (ENT202-R2) - AWS re:Invent 2018
Assessing your Application Portfolio (ENT202-R2) - AWS re:Invent 2018Assessing your Application Portfolio (ENT202-R2) - AWS re:Invent 2018
Assessing your Application Portfolio (ENT202-R2) - AWS re:Invent 2018
 
Wix to Shopify migration checklist.pdf
Wix to Shopify migration checklist.pdfWix to Shopify migration checklist.pdf
Wix to Shopify migration checklist.pdf
 
Quickly Create Data Sets for the Analytics Cloud
Quickly Create Data Sets for the Analytics CloudQuickly Create Data Sets for the Analytics Cloud
Quickly Create Data Sets for the Analytics Cloud
 
Presentation Maintenance Cloud.pdf
Presentation Maintenance Cloud.pdfPresentation Maintenance Cloud.pdf
Presentation Maintenance Cloud.pdf
 
Nirav Kothari: Well-Architected - Operational Excellence Instructor Led Lab.pdf
Nirav Kothari: Well-Architected - Operational Excellence Instructor Led Lab.pdfNirav Kothari: Well-Architected - Operational Excellence Instructor Led Lab.pdf
Nirav Kothari: Well-Architected - Operational Excellence Instructor Led Lab.pdf
 
Building IoT Devices for Regulated Industries (LFS304-i) - AWS re:Invent 2018
Building IoT Devices for Regulated Industries (LFS304-i) - AWS re:Invent 2018Building IoT Devices for Regulated Industries (LFS304-i) - AWS re:Invent 2018
Building IoT Devices for Regulated Industries (LFS304-i) - AWS re:Invent 2018
 
Initiate Edinburgh 2019 - Moving to DevOps the Amazon Way
Initiate Edinburgh 2019 - Moving to DevOps the Amazon WayInitiate Edinburgh 2019 - Moving to DevOps the Amazon Way
Initiate Edinburgh 2019 - Moving to DevOps the Amazon Way
 
Developing a Documentation Portal on Heroku
Developing a Documentation Portal on HerokuDeveloping a Documentation Portal on Heroku
Developing a Documentation Portal on Heroku
 
Moving to DevOps
Moving to DevOpsMoving to DevOps
Moving to DevOps
 
Planning Your Migration to the Lightning Experience
Planning Your Migration to the Lightning ExperiencePlanning Your Migration to the Lightning Experience
Planning Your Migration to the Lightning Experience
 
Taking Identity from the Enterprise to the Cloud
Taking Identity from the Enterprise to the CloudTaking Identity from the Enterprise to the Cloud
Taking Identity from the Enterprise to the Cloud
 
Drive Self-Service & Standardization in the First 100 Days of Your Cloud Migr...
Drive Self-Service & Standardization in the First 100 Days of Your Cloud Migr...Drive Self-Service & Standardization in the First 100 Days of Your Cloud Migr...
Drive Self-Service & Standardization in the First 100 Days of Your Cloud Migr...
 
Deep Dive on AWS CloudFormation
Deep Dive on AWS CloudFormationDeep Dive on AWS CloudFormation
Deep Dive on AWS CloudFormation
 
Visualforce Hack for Junction Objects
Visualforce Hack for Junction ObjectsVisualforce Hack for Junction Objects
Visualforce Hack for Junction Objects
 
打造新一代的企業 IT - Transforming Enterprise IT
打造新一代的企業 IT - Transforming Enterprise IT打造新一代的企業 IT - Transforming Enterprise IT
打造新一代的企業 IT - Transforming Enterprise IT
 
Developing Offline-Capable Apps with the Salesforce Mobile SDK and SmartStore
Developing Offline-Capable Apps with the Salesforce Mobile SDK and SmartStoreDeveloping Offline-Capable Apps with the Salesforce Mobile SDK and SmartStore
Developing Offline-Capable Apps with the Salesforce Mobile SDK and SmartStore
 

More from David Harrison

SchemaStudioTypeLandscape_Article.pdf
SchemaStudioTypeLandscape_Article.pdfSchemaStudioTypeLandscape_Article.pdf
SchemaStudioTypeLandscape_Article.pdfDavid Harrison
 
PhoenixRisingArticle.pdf
PhoenixRisingArticle.pdfPhoenixRisingArticle.pdf
PhoenixRisingArticle.pdfDavid Harrison
 
IntoTheNebulaArticle.pdf
IntoTheNebulaArticle.pdfIntoTheNebulaArticle.pdf
IntoTheNebulaArticle.pdfDavid Harrison
 
Processor Refactoring.pdf
Processor Refactoring.pdfProcessor Refactoring.pdf
Processor Refactoring.pdfDavid Harrison
 
IntoTheNebulaArticle.pdf
IntoTheNebulaArticle.pdfIntoTheNebulaArticle.pdf
IntoTheNebulaArticle.pdfDavid Harrison
 
Generation_XSD_Article - Part 4.pdf
Generation_XSD_Article - Part 4.pdfGeneration_XSD_Article - Part 4.pdf
Generation_XSD_Article - Part 4.pdfDavid Harrison
 
PhoenixRisingArticle.pdf
PhoenixRisingArticle.pdfPhoenixRisingArticle.pdf
PhoenixRisingArticle.pdfDavid Harrison
 
Generation_XSD_Article - Part 3.pdf
Generation_XSD_Article - Part 3.pdfGeneration_XSD_Article - Part 3.pdf
Generation_XSD_Article - Part 3.pdfDavid Harrison
 
Generation_XSD_Article - Part 2.pdf
Generation_XSD_Article - Part 2.pdfGeneration_XSD_Article - Part 2.pdf
Generation_XSD_Article - Part 2.pdfDavid Harrison
 
Generation_XSD_Article.docx
Generation_XSD_Article.docxGeneration_XSD_Article.docx
Generation_XSD_Article.docxDavid Harrison
 
Flavours - Classic/Technical BDD
Flavours - Classic/Technical BDDFlavours - Classic/Technical BDD
Flavours - Classic/Technical BDDDavid Harrison
 
Babble article - Test Automation & Text Translation
Babble article - Test Automation & Text TranslationBabble article - Test Automation & Text Translation
Babble article - Test Automation & Text TranslationDavid Harrison
 
Selenium Testing @ Agile Speed
Selenium Testing @ Agile SpeedSelenium Testing @ Agile Speed
Selenium Testing @ Agile SpeedDavid Harrison
 
Workflow Test Automation
Workflow Test AutomationWorkflow Test Automation
Workflow Test AutomationDavid Harrison
 
Et sensus agile documentation
Et sensus   agile documentationEt sensus   agile documentation
Et sensus agile documentationDavid Harrison
 

More from David Harrison (20)

SchemaStudioTypeLandscape_Article.pdf
SchemaStudioTypeLandscape_Article.pdfSchemaStudioTypeLandscape_Article.pdf
SchemaStudioTypeLandscape_Article.pdf
 
PhoenixRisingArticle.pdf
PhoenixRisingArticle.pdfPhoenixRisingArticle.pdf
PhoenixRisingArticle.pdf
 
IntoTheNebulaArticle.pdf
IntoTheNebulaArticle.pdfIntoTheNebulaArticle.pdf
IntoTheNebulaArticle.pdf
 
Processor Refactoring.pdf
Processor Refactoring.pdfProcessor Refactoring.pdf
Processor Refactoring.pdf
 
PagesToGo.pdf
PagesToGo.pdfPagesToGo.pdf
PagesToGo.pdf
 
IntoTheNebulaArticle.pdf
IntoTheNebulaArticle.pdfIntoTheNebulaArticle.pdf
IntoTheNebulaArticle.pdf
 
Generation_XSD_Article - Part 4.pdf
Generation_XSD_Article - Part 4.pdfGeneration_XSD_Article - Part 4.pdf
Generation_XSD_Article - Part 4.pdf
 
PhoenixRisingArticle.pdf
PhoenixRisingArticle.pdfPhoenixRisingArticle.pdf
PhoenixRisingArticle.pdf
 
Generation_XSD_Article - Part 3.pdf
Generation_XSD_Article - Part 3.pdfGeneration_XSD_Article - Part 3.pdf
Generation_XSD_Article - Part 3.pdf
 
Generation_XSD_Article - Part 2.pdf
Generation_XSD_Article - Part 2.pdfGeneration_XSD_Article - Part 2.pdf
Generation_XSD_Article - Part 2.pdf
 
Generation_XSD_Article.docx
Generation_XSD_Article.docxGeneration_XSD_Article.docx
Generation_XSD_Article.docx
 
Test data article
Test data articleTest data article
Test data article
 
Flavours - Classic/Technical BDD
Flavours - Classic/Technical BDDFlavours - Classic/Technical BDD
Flavours - Classic/Technical BDD
 
Babble article - Test Automation & Text Translation
Babble article - Test Automation & Text TranslationBabble article - Test Automation & Text Translation
Babble article - Test Automation & Text Translation
 
Bdd Show and Tell
Bdd Show and TellBdd Show and Tell
Bdd Show and Tell
 
UI Testing Pattern
UI Testing PatternUI Testing Pattern
UI Testing Pattern
 
Soap ui automation
Soap ui automationSoap ui automation
Soap ui automation
 
Selenium Testing @ Agile Speed
Selenium Testing @ Agile SpeedSelenium Testing @ Agile Speed
Selenium Testing @ Agile Speed
 
Workflow Test Automation
Workflow Test AutomationWorkflow Test Automation
Workflow Test Automation
 
Et sensus agile documentation
Et sensus   agile documentationEt sensus   agile documentation
Et sensus agile documentation
 

Recently uploaded

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyAnusha Are
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedDelhi Call girls
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfayushiqss
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
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
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxalwaysnagaraju26
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 

Recently uploaded (20)

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
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
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 

High sierra part 1

  • 1. High Sierra Selenium-based Testing Validation, Workflow, Zalenium, Azure Part 1 of 3 Copyright © 2019 David Harrison Part 1 – Validation, Zalenium
  • 2. Context 01 02 03 04 We are predominantly testing Assert-Assert-Assert is the basic mantra of Test Automation Sometimes we simulate something Maybe we want to generate special data…etc. We are members of a project Whether Waterfall or Agile, we are participants We are developing business value We construct & deliver something of value to the project © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
  • 3. The Story What will be covered in this presentation Validation is KING. This is the bedrock of what we do in Test Automation, as in any testing Validation When we have a mid- to large- volume of tests, using a scalable execution platform is something to be considered Zalenium 01 03 04 © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
  • 4. The Target Application This web site provides an elegant, and challenging, platform for Test Automation approaches to be developed: Site: http://automationpractice.com/index.php Its key themes are: • Account creation • Login for account holders • Shopping for items in a store • Search for items in store • Shopping Cart • Check out • Delivery information • Logout • Strip Page site Target Application © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
  • 5. The Approach The approach showcased in this series, has the following characteristics: • Validation: Unit Tests C#-based (https://docs.microsoft.com/en- us/dotnet/core/testing/) • Selenium-based tests (https://www.seleniumhq.org/) • Workflow: Specflow-based (https://specflow.org/) • Zalenium: (http://opensource.zalando.com/zalenium/) • Azure Cloud: (https://docs.microsoft.com/en- us/azure/devops/pipelines/test/continuous-test-selenium?view=azure-devops) Approach © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
  • 6. © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/ • Shop product groups • Shop tabs • Shop items have overlay @ hover • Shop items have “Quick view” link on hover • Items have offers/reductions
  • 7. Key Points What are the important aspects of the app? The application is built using Ajax so we need to be very aware of “waiting” for elements. Ajax Validating items in the storefront involves dealing with multiple pages and overlays/offers/reductions etc. Storefront Some of the Footer elements (in principle) declare the legal basis for using the shopping site. We need to validate the legal text. Legal 01 02 03 A key element of this site is the state of the Shopping Cart. This we need to validate. Shopping Cart 04 Validating the correctness of key business workflows is crucial to the testing of this site. Business Workflow 05 © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
  • 8. Validation What do we validate? We validate that some key page elements exist. Existence We validate that some key items are visible when they are expected to be. Visibility We validate that the strip page can be moved and that certain elements become visible/(not visible). Movement 01 02 03 Validate that the store items on the Main page display the appropriate data. Storefront 04 Validate that the page footer shows the appropriate important links – and that they show the correct data (legal text). Page Footer 05 © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
  • 9. Key Points © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/ • We use a test properties object to manage generic and test-specific propertie s • We use Log4Net as our logging infrastructure • We use of certain frameworks such as “DotNetSelenium.Extras.WaitHelpers” to provide element wait functionality • The Page Objects are generated by Se34 (https://www.dharrisonch.com/) • For certain “special” operations we will use Selenium WebDriver JavaScript (because of app “features”) • For this example we use C#/.Net but we could equally as well be using Java • We use the Chrome browser
  • 10. Generating Page Objects © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/ • Metadata describing “pages” (validations, operations etc) • Se34 used to generate fully finished Page Object Classes (C#/Java) • App change -> update ->re-generate
  • 11. Generating Page Properties © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/ • Se34 used to generate Property files (optional) • App change -> update ->re-generate • Dynamic (run-time) values can be dealt with using an Oracle (“xx = ?”)
  • 12. UT - Assembly Initialization © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/ • Adding test properties • Set up Log4Net
  • 13. UT - Test Class Instantiation © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/ • Set up test base class • Set up the site form • Initialise the validation bit mask • Initialise browser • Initialise the shop data • Initialise the error bit mask
  • 14. UT - Test Initialization © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/ • This is executed per unit test! • Are we executing local tests? • Configure WebDriver • Maximise the browser window • Set the implicit wait interval • Instantiate the MainPage • Navigate to it • Wait for it
  • 15. Initialise UT-Specific Properties © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
  • 16. UT - Test Cleanup © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/ Quit the driver – we renew the driver for each test
  • 17. UT - Validate Existence • Check that this UT can run (local, remote etc) • Note fluent validation statement • Check if errors detected • Just a selection of possibilities © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
  • 18. UT - Validate Visibility • Check that this UT can run (local, remote etc) • Use base class methods to check for visibility • Use base class methods to move to bottom of strip page • Just a selection of possibilities © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
  • 19. UT - Validate Movement • Check visibilities of elements when scrolling the page • Using base class methods to scroll strip page • Using base class methods to check for visibility • Just a selection of possibilities © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
  • 20. UT - Validate Storefront (1) • Validate items for each type of storefront • Select Store Tab and use local test method to do the heavy lifting • Log & Assert • Just a selection of possibilities © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
  • 21. UT - Validate Storefront (2) • Local method that performs Asserts • Need to manage physical cursor because of item overlay • Loop over items in the configured shop data • Need to take care of item overlay (frame) (move physical cursor by small amount) • Build the image, and other XPath expressions • Configure a local wait object • We cant configure the XPath expressions for all the elements of an item, they depend on whether the item has a reduction (dynamic) © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
  • 22. UT - Validate Storefront (3) • Check the existence of the various pieces of the displayed item data • Make us of the test properties to get data • Move physical cursor if the item data suggests a reduction (remove overlay) • Validate Price/Old Price/Reduction as required © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
  • 23. UT - Validate Storefront (4) • Build the XPath expressions for the various parts of the dynamic elements • Check existence & value (against configured test data) © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
  • 24. Validate Storefront (5) • Validate the item Price • Click on the image (NOT Quick View link) • Instantiate ItemDetailPage • Validate ItemDetailPage (local method) © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
  • 25. Validate Storefront (6) • Validate existence of elements on ItemDetailsPage • Validation of values – left for interested reader (see Page Object) © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
  • 26. Validate Login (1) © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/ • Validate Account login (local method) • Instantiate Account Page • Validate content existence • Validation of values – left for the interested reader
  • 27. Validate Login (2) © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/ • Local method that does Asserts (assumes valid credentials) • Click the Sign-In “label” on the Main Page • Instantiate Sign-In/(Account Creation) Page • Validate content existence • Values – left for interested reader (see Page Object) • Enter the email specified by parameter • Enter the password specified by parameter • Click the Sign-In button • Instantiate the Account Page • Wait for the Account Page to appear • Existence & Values – left for interested reader (see Page Object)
  • 28. Results © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/ • Execution in VS Test Explorer • We don’t execute “create account” tests as no means to remove created accounts
  • 29. Zalenium Test Execution • Undefine runtime param in UT code • -> leads to Config of RemoteWebDriver (base class method call) © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
  • 30. Zalenium Test Execution • Batch files (execute in cmd.exe): • Pull down the most recent images • Start Zalenium via Docker • There are a range of configuration parameters that can be used when starting Zalenium (see: https://opensource.zalando.com/zalenium/) © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
  • 31. Zalenium Test Output • Example execution: Account Page © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
  • 32. Summary Where are we? © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
  • 33. Key Points Below are the main points to be borne in mind about test automation The code we produce should reflect development practice – not the outcome of cooking Spaghetti! It’s Development The focus of what we do should be establishing “correctness” of the application in the context of each test. It’s Testing The tests we write must execute routinely attributes – particularly when we go to a DevOps pipeline. It’s Reliable 01 02 03 Tests must meet up to these key attributes – particularly when we go to a DevOps pipeline. It’s Maintainable, Accessible, Scalable 04 © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
  • 34. This slide pack has covered the basic Selenium-based testing validation for a specific web application, a shopping site. Some of the detail, such as ensuring the values of things on the individual pages, has been “left to the interested reader”, as they say. All the methods to do this are available in the individual Page Objects. We have looked at a subset of testing targets for this site, but in doing so we have arrived at a scalable testing approach which can be readily expanded. The use of generated Page Object classes is a key take-away of this presentation. If, as test automation practitioners, we want to be players in the Agile project story, then what we do must be “sprintable” - able to be broken down, confidently, into Stories. The generation of finished Page Objects is key to achieving this worthy goal. Two themes when using Selenium: • Perform exploratory testing on the app to understand how it fits together • Be prepared to wait for pages and elements (and sometimes element content) in your test code This slide pack is one in a series related to Selenium-based test automation. Summary © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/
  • 35. Thank you All views…All voices…All welcome https://www.linkedin.com/in/david-harrison-2952187/ © 2019 David Harrison, dharrison_ch@yahoo.co.uk, https://www.dharrisonch.com/, https://www.slideshare.net/DavidHarrison20/