SlideShare a Scribd company logo
Automated UI Testing with
Selenium WebDriver
Automated UI Testing with Selenium
CollabSphere 2018 Sponsors
Automated UI Testing with Selenium
Slobodan Lohja
Full stack developer focus on open
source technologies.
Working with Domino since version
4.5.
Fan of enterprise Java, XPages, Spring
and Hibernate.
I learned to enjoy enterprise java
development over the years.
Agenda
• Introduction
• Workstation Setup
• Project hands on
• Tips
Automated UI Testing with Selenium
• Manual Testers
• Test Engineers
• Managers
• Automation Engineer
Introduction – Who is it for?
Automated UI Testing with Selenium
• Tool that covers multiple browsers across
platforms.
• Supports many Programming languages
• Can simulate a user case and validate
check points
• Open Source free of cost
Introduction – Why Selenium
Automated UI Testing with Selenium
Selenium IDE
• Record and Play
• Does not scale on large projects
• Only used with Firefox.
Selenium RC
• Supports multiple OS, browsers and languages
• Works on any browser that supports Javascript.
• JavaScript injection can be blocked in some
browsers
• Deprecated by Selenium Web Driver
Introduction – Selenium Components
Automated UI Testing with Selenium
Selenium WebDriver
• JavaScript injection removed.
• Supports multiple OS, browsers and languages
• No Server needed
• iOS and Android support
• Interacts with browser native code
Selenium Grid – Parallel/Sequential Execution
• Designed to distribute test cases to many
machines
Introduction – Selenium Components
Automated UI Testing with Selenium
Each browser manufacturer produces
a WebDriver
Introduction – WebDriver
WebDriver
Interface
(APIs)
Firefox
Driver
Safari
Driver
Chrome
Driver
Others
User
Code
Automated UI Testing with Selenium
Agenda
• Introduction
• Workstation Setup
• Project hands on
• Tips
Automated UI Testing with Selenium
• Java SE Development Kit (JDK)
• Eclipse IDE (Maven included)
• WebDrivers for each browser
• Selenium WebDriver Jar libraries
• “Try Xpath” Firefox Add On
Workstation Setup
Automated UI Testing with Selenium
• https://www.seleniumhq.org/download/
• Save Selenium Java JARS into c:libsselenium
• Save WebDrivers to a common directory
c:webdrivers
Workstation Setup - WebDriver Links
Automated UI Testing with Selenium
Agenda
• Introduction
• Workstation Setup
• Project hands on
• Tips
Automated UI Testing with Selenium
package com.xpagesbeast.test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class TestSuite {
public static void main(String[] args) {
WebDriver driver;
System.setProperty("webdriver.gecko.driver", "/webdrivers/geckodriver.exe");
driver = new FirefoxDriver();
String baseURL = "http://www.google.com";
driver.get(baseURL);
}
}
Project Hands On – Simple proof of concept
Automated UI Testing with Selenium
Project Hands On – Simple proof of concept
Find html elements by these attributes:
• Id
• Name
• Class Name
• XPath
• Link Text
• Partial Link Text
• Tag Name
• CSS Selector
Automated UI Testing with Selenium
Project Hands On – Advanced CSS Selectors
Find html elements by these attributes:
• Tag[attribute=‘value’]
• .class1.class2.class3 append until we find
an element
Automated UI Testing with Selenium
Project Hands On – Advanced CSS Selectors
Find html elements by these wildcards:
“^” represents the starting text
“$” represents the ending text
“*” represents the text contained
Example:
Tag[attribute<wildcard>=‘value’]
Input[class^=‘requiredInput’]
Automated UI Testing with Selenium
Project Hands On – Advanced CSS Selectors
Find child html elements:
“>” children
Example:
tag>tag
fieldset>input
Fieldset>input#name
Automated UI Testing with Selenium
Project Hands On – XPath Selectors
Find child html elements:
• Sing ‘/’ look inside the parent (relative)
• Double ‘//’ look for any child or nested children element inside
the parent.
//tag[@attribute=‘value’
//tag[text()=‘value’] -> Find based on text in between tag.
Example:
.//*[#id=‘navbar’]
Tip: Once you find the element, replace ‘*’ with proper tag.
Automated UI Testing with Selenium
Agenda
• Introduction
• Workstation Setup
• Project hands on
• Tips
Automated UI Testing with Selenium
• Selenium WebDriver --‐> 3.0.1
• Gecko Driver --‐>0.11.1
• FF --‐> 49.0.2
• If you get errors, check your versions are
compatible.
Tips
Automated UI Testing with Selenium
• java.lang.IllegalStateException:
The path to the driver executable must be set by
the webdriver.gecko.driver system poperty;
Tips
Automated UI Testing with Selenium
System.setProperty("webdriver.gecko.driver",
"/webdrivers/geckodriver.exe");
Every Java program that starts launches its own
JVM instance (process). The System.Property is a
HashMap (key value pair). There is one for every
JVM Instance (one for every Java process).
Tips
Automated UI Testing with Selenium
Driver.findElement(By.tagName(“a”)).click();
Hardly used, finds first <a /> tag and clicks it in
the DOM.
Opposite with the By Id methods gives an error if
there is more than one found.
Tips
Automated UI Testing with Selenium
Slobodan Lohja
Blog: uxdesign.xpagesbeast.com
Email: slohja@hotmail.com
LinkedIn: linkedin.com/in/slobodanlohja/
Twitter: @xpagesbeast
Automated UI Testing with Selenium
Ad

More Related Content

What's hot (20)

PHP Indonesia - Nodejs Web Development
PHP Indonesia - Nodejs Web DevelopmentPHP Indonesia - Nodejs Web Development
PHP Indonesia - Nodejs Web Development
Irfan Maulana
 
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
Paul Withers
 
Case study: JBoss Developer Studio, an IDE for Web, Mobile and Cloud applicat...
Case study: JBoss Developer Studio, an IDE for Web, Mobile and Cloud applicat...Case study: JBoss Developer Studio, an IDE for Web, Mobile and Cloud applicat...
Case study: JBoss Developer Studio, an IDE for Web, Mobile and Cloud applicat...
Max Andersen
 
Dockerizing BDD : Ruby-Cucumber Example
Dockerizing BDD : Ruby-Cucumber ExampleDockerizing BDD : Ruby-Cucumber Example
Dockerizing BDD : Ruby-Cucumber Example
Shashikant Jagtap
 
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages HeavenIBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
Paul Withers
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With Selenium
Marakana Inc.
 
OpenNTF Webinar May 2021 - Jesse
OpenNTF Webinar May 2021 - JesseOpenNTF Webinar May 2021 - Jesse
OpenNTF Webinar May 2021 - Jesse
Jesse Gallagher
 
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
Jesse Gallagher
 
Dockercon EU 2015
Dockercon EU 2015Dockercon EU 2015
Dockercon EU 2015
John Fiedler
 
Hack & Fix, Hands on ColdFusion Security Training
Hack & Fix, Hands on ColdFusion Security TrainingHack & Fix, Hands on ColdFusion Security Training
Hack & Fix, Hands on ColdFusion Security Training
ColdFusionConference
 
Play! Framework for JavaEE Developers
Play! Framework for JavaEE DevelopersPlay! Framework for JavaEE Developers
Play! Framework for JavaEE Developers
Teng Shiu Huang
 
Selenium-Grid-Extras
Selenium-Grid-ExtrasSelenium-Grid-Extras
Selenium-Grid-Extras
Shawn McCarthy
 
Session on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh GundechaSession on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh Gundecha
Agile Testing Alliance
 
2013 10-28 php ug presentation - ci using phing and hudson
2013 10-28 php ug presentation - ci using phing and hudson2013 10-28 php ug presentation - ci using phing and hudson
2013 10-28 php ug presentation - ci using phing and hudson
Shreeniwas Iyer
 
Using CI for continuous delivery Part 1
Using CI for continuous delivery Part 1Using CI for continuous delivery Part 1
Using CI for continuous delivery Part 1
Vishal Biyani
 
Intro
IntroIntro
Intro
Vivek Rajasekar
 
Continuous Updating with VersionEye at code.talks 2014
Continuous Updating with VersionEye at code.talks 2014Continuous Updating with VersionEye at code.talks 2014
Continuous Updating with VersionEye at code.talks 2014
Robert Reiz
 
Using Play Framework 2 in production
Using Play Framework 2 in productionUsing Play Framework 2 in production
Using Play Framework 2 in production
Christian Papauschek
 
Don Wibier
Don WibierDon Wibier
Don Wibier
CodeFest
 
CubeJS: eBay’s Node.js Adoption Journey
CubeJS: eBay’s Node.js Adoption JourneyCubeJS: eBay’s Node.js Adoption Journey
CubeJS: eBay’s Node.js Adoption Journey
Patrick Steele-Idem
 
PHP Indonesia - Nodejs Web Development
PHP Indonesia - Nodejs Web DevelopmentPHP Indonesia - Nodejs Web Development
PHP Indonesia - Nodejs Web Development
Irfan Maulana
 
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
Paul Withers
 
Case study: JBoss Developer Studio, an IDE for Web, Mobile and Cloud applicat...
Case study: JBoss Developer Studio, an IDE for Web, Mobile and Cloud applicat...Case study: JBoss Developer Studio, an IDE for Web, Mobile and Cloud applicat...
Case study: JBoss Developer Studio, an IDE for Web, Mobile and Cloud applicat...
Max Andersen
 
Dockerizing BDD : Ruby-Cucumber Example
Dockerizing BDD : Ruby-Cucumber ExampleDockerizing BDD : Ruby-Cucumber Example
Dockerizing BDD : Ruby-Cucumber Example
Shashikant Jagtap
 
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages HeavenIBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
Paul Withers
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With Selenium
Marakana Inc.
 
OpenNTF Webinar May 2021 - Jesse
OpenNTF Webinar May 2021 - JesseOpenNTF Webinar May 2021 - Jesse
OpenNTF Webinar May 2021 - Jesse
Jesse Gallagher
 
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
Jesse Gallagher
 
Hack & Fix, Hands on ColdFusion Security Training
Hack & Fix, Hands on ColdFusion Security TrainingHack & Fix, Hands on ColdFusion Security Training
Hack & Fix, Hands on ColdFusion Security Training
ColdFusionConference
 
Play! Framework for JavaEE Developers
Play! Framework for JavaEE DevelopersPlay! Framework for JavaEE Developers
Play! Framework for JavaEE Developers
Teng Shiu Huang
 
Session on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh GundechaSession on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh Gundecha
Agile Testing Alliance
 
2013 10-28 php ug presentation - ci using phing and hudson
2013 10-28 php ug presentation - ci using phing and hudson2013 10-28 php ug presentation - ci using phing and hudson
2013 10-28 php ug presentation - ci using phing and hudson
Shreeniwas Iyer
 
Using CI for continuous delivery Part 1
Using CI for continuous delivery Part 1Using CI for continuous delivery Part 1
Using CI for continuous delivery Part 1
Vishal Biyani
 
Continuous Updating with VersionEye at code.talks 2014
Continuous Updating with VersionEye at code.talks 2014Continuous Updating with VersionEye at code.talks 2014
Continuous Updating with VersionEye at code.talks 2014
Robert Reiz
 
Using Play Framework 2 in production
Using Play Framework 2 in productionUsing Play Framework 2 in production
Using Play Framework 2 in production
Christian Papauschek
 
Don Wibier
Don WibierDon Wibier
Don Wibier
CodeFest
 
CubeJS: eBay’s Node.js Adoption Journey
CubeJS: eBay’s Node.js Adoption JourneyCubeJS: eBay’s Node.js Adoption Journey
CubeJS: eBay’s Node.js Adoption Journey
Patrick Steele-Idem
 

Similar to Automated ui-testing (20)

Selenium.pptx
Selenium.pptxSelenium.pptx
Selenium.pptx
orbitprojects
 
Selenium- A Software Testing Tool
Selenium- A Software Testing ToolSelenium- A Software Testing Tool
Selenium- A Software Testing Tool
Zeba Tahseen
 
Introduction to selenium
Introduction to seleniumIntroduction to selenium
Introduction to selenium
Khaja Moiz Uddin
 
Introduction to selenium
Introduction to seleniumIntroduction to selenium
Introduction to selenium
Khaja Moiz Uddin
 
Best java automation training institute in Bangalore - Selenium Labs
Best java automation training institute in Bangalore - Selenium Labs Best java automation training institute in Bangalore - Selenium Labs
Best java automation training institute in Bangalore - Selenium Labs
Selenium Labs
 
Selenium for everyone
Selenium for everyoneSelenium for everyone
Selenium for everyone
Tft Us
 
Selenium Topic 2 IDE
Selenium Topic 2 IDESelenium Topic 2 IDE
Selenium Topic 2 IDE
ITProfessional Academy
 
Selenium web driver_2.0_presentation
Selenium web driver_2.0_presentationSelenium web driver_2.0_presentation
Selenium web driver_2.0_presentation
sayhi2sudarshan
 
Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully
Applitools
 
Presentation On Selenium testing and its parts
Presentation On Selenium testing and its partsPresentation On Selenium testing and its parts
Presentation On Selenium testing and its parts
nrwdbxw5tx
 
How to use selenium successfully
How to use selenium successfullyHow to use selenium successfully
How to use selenium successfully
TEST Huddle
 
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Simplilearn
 
Selenium – Web Browser Automation
Selenium – Web Browser AutomationSelenium – Web Browser Automation
Selenium – Web Browser Automation
Pakorn Weecharungsan
 
Selenium presentation
Selenium presentationSelenium presentation
Selenium presentation
shivani thakur
 
11-01-2023.pptx
11-01-2023.pptx11-01-2023.pptx
11-01-2023.pptx
AshokKumar424042
 
Selenium using Java
Selenium using JavaSelenium using Java
Selenium using Java
F K
 
Selenium
SeleniumSelenium
Selenium
Jahan Murugassan
 
Selenium
SeleniumSelenium
Selenium
David Rajah Selvaraj
 
Selenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep ShardaSelenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep Sharda
Er. Sndp Srda
 
Selenium (1) (1)
Selenium (1) (1)Selenium (1) (1)
Selenium (1) (1)
Vishwan Aranha
 
Selenium- A Software Testing Tool
Selenium- A Software Testing ToolSelenium- A Software Testing Tool
Selenium- A Software Testing Tool
Zeba Tahseen
 
Best java automation training institute in Bangalore - Selenium Labs
Best java automation training institute in Bangalore - Selenium Labs Best java automation training institute in Bangalore - Selenium Labs
Best java automation training institute in Bangalore - Selenium Labs
Selenium Labs
 
Selenium for everyone
Selenium for everyoneSelenium for everyone
Selenium for everyone
Tft Us
 
Selenium web driver_2.0_presentation
Selenium web driver_2.0_presentationSelenium web driver_2.0_presentation
Selenium web driver_2.0_presentation
sayhi2sudarshan
 
Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully
Applitools
 
Presentation On Selenium testing and its parts
Presentation On Selenium testing and its partsPresentation On Selenium testing and its parts
Presentation On Selenium testing and its parts
nrwdbxw5tx
 
How to use selenium successfully
How to use selenium successfullyHow to use selenium successfully
How to use selenium successfully
TEST Huddle
 
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Simplilearn
 
Selenium – Web Browser Automation
Selenium – Web Browser AutomationSelenium – Web Browser Automation
Selenium – Web Browser Automation
Pakorn Weecharungsan
 
Selenium using Java
Selenium using JavaSelenium using Java
Selenium using Java
F K
 
Selenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep ShardaSelenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep Sharda
Er. Sndp Srda
 
Ad

More from Slobodan Lohja (7)

Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021
Slobodan Lohja
 
Domino on docker version 2
Domino on docker version 2Domino on docker version 2
Domino on docker version 2
Slobodan Lohja
 
Enable Domino Data Access Services (DAS)
Enable Domino Data Access Services (DAS)Enable Domino Data Access Services (DAS)
Enable Domino Data Access Services (DAS)
Slobodan Lohja
 
JSF ActionListeners with XPages and Java Debugging XPages
JSF ActionListeners with XPages and Java Debugging XPagesJSF ActionListeners with XPages and Java Debugging XPages
JSF ActionListeners with XPages and Java Debugging XPages
Slobodan Lohja
 
How to adopt team development and source control rev2
How to adopt team development and source control rev2How to adopt team development and source control rev2
How to adopt team development and source control rev2
Slobodan Lohja
 
Domino on docker version 1
Domino on docker version 1Domino on docker version 1
Domino on docker version 1
Slobodan Lohja
 
Git for IBM Notes Designer
Git for IBM Notes DesignerGit for IBM Notes Designer
Git for IBM Notes Designer
Slobodan Lohja
 
Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021
Slobodan Lohja
 
Domino on docker version 2
Domino on docker version 2Domino on docker version 2
Domino on docker version 2
Slobodan Lohja
 
Enable Domino Data Access Services (DAS)
Enable Domino Data Access Services (DAS)Enable Domino Data Access Services (DAS)
Enable Domino Data Access Services (DAS)
Slobodan Lohja
 
JSF ActionListeners with XPages and Java Debugging XPages
JSF ActionListeners with XPages and Java Debugging XPagesJSF ActionListeners with XPages and Java Debugging XPages
JSF ActionListeners with XPages and Java Debugging XPages
Slobodan Lohja
 
How to adopt team development and source control rev2
How to adopt team development and source control rev2How to adopt team development and source control rev2
How to adopt team development and source control rev2
Slobodan Lohja
 
Domino on docker version 1
Domino on docker version 1Domino on docker version 1
Domino on docker version 1
Slobodan Lohja
 
Git for IBM Notes Designer
Git for IBM Notes DesignerGit for IBM Notes Designer
Git for IBM Notes Designer
Slobodan Lohja
 
Ad

Recently uploaded (20)

Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 

Automated ui-testing

  • 1. Automated UI Testing with Selenium WebDriver Automated UI Testing with Selenium
  • 3. Automated UI Testing with Selenium Slobodan Lohja Full stack developer focus on open source technologies. Working with Domino since version 4.5. Fan of enterprise Java, XPages, Spring and Hibernate. I learned to enjoy enterprise java development over the years.
  • 4. Agenda • Introduction • Workstation Setup • Project hands on • Tips Automated UI Testing with Selenium
  • 5. • Manual Testers • Test Engineers • Managers • Automation Engineer Introduction – Who is it for? Automated UI Testing with Selenium
  • 6. • Tool that covers multiple browsers across platforms. • Supports many Programming languages • Can simulate a user case and validate check points • Open Source free of cost Introduction – Why Selenium Automated UI Testing with Selenium
  • 7. Selenium IDE • Record and Play • Does not scale on large projects • Only used with Firefox. Selenium RC • Supports multiple OS, browsers and languages • Works on any browser that supports Javascript. • JavaScript injection can be blocked in some browsers • Deprecated by Selenium Web Driver Introduction – Selenium Components Automated UI Testing with Selenium
  • 8. Selenium WebDriver • JavaScript injection removed. • Supports multiple OS, browsers and languages • No Server needed • iOS and Android support • Interacts with browser native code Selenium Grid – Parallel/Sequential Execution • Designed to distribute test cases to many machines Introduction – Selenium Components Automated UI Testing with Selenium
  • 9. Each browser manufacturer produces a WebDriver Introduction – WebDriver WebDriver Interface (APIs) Firefox Driver Safari Driver Chrome Driver Others User Code Automated UI Testing with Selenium
  • 10. Agenda • Introduction • Workstation Setup • Project hands on • Tips Automated UI Testing with Selenium
  • 11. • Java SE Development Kit (JDK) • Eclipse IDE (Maven included) • WebDrivers for each browser • Selenium WebDriver Jar libraries • “Try Xpath” Firefox Add On Workstation Setup Automated UI Testing with Selenium
  • 12. • https://www.seleniumhq.org/download/ • Save Selenium Java JARS into c:libsselenium • Save WebDrivers to a common directory c:webdrivers Workstation Setup - WebDriver Links Automated UI Testing with Selenium
  • 13. Agenda • Introduction • Workstation Setup • Project hands on • Tips Automated UI Testing with Selenium
  • 14. package com.xpagesbeast.test; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; public class TestSuite { public static void main(String[] args) { WebDriver driver; System.setProperty("webdriver.gecko.driver", "/webdrivers/geckodriver.exe"); driver = new FirefoxDriver(); String baseURL = "http://www.google.com"; driver.get(baseURL); } } Project Hands On – Simple proof of concept Automated UI Testing with Selenium
  • 15. Project Hands On – Simple proof of concept Find html elements by these attributes: • Id • Name • Class Name • XPath • Link Text • Partial Link Text • Tag Name • CSS Selector Automated UI Testing with Selenium
  • 16. Project Hands On – Advanced CSS Selectors Find html elements by these attributes: • Tag[attribute=‘value’] • .class1.class2.class3 append until we find an element Automated UI Testing with Selenium
  • 17. Project Hands On – Advanced CSS Selectors Find html elements by these wildcards: “^” represents the starting text “$” represents the ending text “*” represents the text contained Example: Tag[attribute<wildcard>=‘value’] Input[class^=‘requiredInput’] Automated UI Testing with Selenium
  • 18. Project Hands On – Advanced CSS Selectors Find child html elements: “>” children Example: tag>tag fieldset>input Fieldset>input#name Automated UI Testing with Selenium
  • 19. Project Hands On – XPath Selectors Find child html elements: • Sing ‘/’ look inside the parent (relative) • Double ‘//’ look for any child or nested children element inside the parent. //tag[@attribute=‘value’ //tag[text()=‘value’] -> Find based on text in between tag. Example: .//*[#id=‘navbar’] Tip: Once you find the element, replace ‘*’ with proper tag. Automated UI Testing with Selenium
  • 20. Agenda • Introduction • Workstation Setup • Project hands on • Tips Automated UI Testing with Selenium
  • 21. • Selenium WebDriver --‐> 3.0.1 • Gecko Driver --‐>0.11.1 • FF --‐> 49.0.2 • If you get errors, check your versions are compatible. Tips Automated UI Testing with Selenium
  • 22. • java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.gecko.driver system poperty; Tips Automated UI Testing with Selenium
  • 23. System.setProperty("webdriver.gecko.driver", "/webdrivers/geckodriver.exe"); Every Java program that starts launches its own JVM instance (process). The System.Property is a HashMap (key value pair). There is one for every JVM Instance (one for every Java process). Tips Automated UI Testing with Selenium
  • 24. Driver.findElement(By.tagName(“a”)).click(); Hardly used, finds first <a /> tag and clicks it in the DOM. Opposite with the By Id methods gives an error if there is more than one found. Tips Automated UI Testing with Selenium
  • 25. Slobodan Lohja Blog: uxdesign.xpagesbeast.com Email: [email protected] LinkedIn: linkedin.com/in/slobodanlohja/ Twitter: @xpagesbeast Automated UI Testing with Selenium

Editor's Notes

  • #6: Manual Testers = who want to switch to automated testing to become a test engineer Test Engineers = Managers = if you manage developers or quality assurance teams. Career change, want to become a Automation Engineer.
  • #7: Automate on Mac, Linux, and Windows Automate in Java, Python, PHP, Ruby (flexibility) – designed for Java, and this demo is on Java
  • #8: Selenium RC tries to overcome the limitations of Selenium IDE It’s deprecated by Selenium Web Driver, Javascript injection is blocked in some browsers. Automate in Java, Python, PHP, Ruby (flexibility) – designed for Java, and this demo is on Java Future is Selenium Web Driver
  • #9: Selenium RC tries to overcome the limitations of Selenium IDE It’s deprecated by Selenium Web Driver, Javascript injection is blocked in some browsers. Automate in Java, Python, PHP, Ruby (flexibility) – designed for Java, and this demo is on Java Future is Selenium Web Driver
  • #10: Java or Python code is written against the API and the driver uses the native browser code to test the UI. Code written once against all browsers, they follow the API.
  • #12: Maven is included in the latest Eclipse
  • #13: Maven is included in the latest Eclipse
  • #22: Maven is included in the latest Eclipse
  • #23: Maven is included in the latest Eclipse
  • #24: Maven is included in the latest Eclipse
  • #25: Maven is included in the latest Eclipse