SlideShare ist ein Scribd-Unternehmen logo
1 von 25
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

Weitere ähnliche Inhalte

Was ist angesagt?

PHP Indonesia - Nodejs Web Development
PHP Indonesia - Nodejs Web DevelopmentPHP Indonesia - Nodejs Web Development
PHP Indonesia - Nodejs Web DevelopmentIrfan 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 ExampleShashikant 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 HeavenPaul Withers
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With SeleniumMarakana Inc.
 
OpenNTF Webinar May 2021 - Jesse
OpenNTF Webinar May 2021 - JesseOpenNTF Webinar May 2021 - Jesse
OpenNTF Webinar May 2021 - JesseJesse 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 TrainingColdFusionConference
 
Play! Framework for JavaEE Developers
Play! Framework for JavaEE DevelopersPlay! Framework for JavaEE Developers
Play! Framework for JavaEE DevelopersTeng 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 GundechaAgile 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 hudsonShreeniwas 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 1Vishal 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 2014Robert Reiz
 
Using Play Framework 2 in production
Using Play Framework 2 in productionUsing Play Framework 2 in production
Using Play Framework 2 in productionChristian Papauschek
 
Don Wibier
Don WibierDon Wibier
Don WibierCodeFest
 
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 JourneyPatrick Steele-Idem
 

Was ist angesagt? (20)

PHP Indonesia - Nodejs Web Development
PHP Indonesia - Nodejs Web DevelopmentPHP Indonesia - Nodejs Web Development
PHP Indonesia - Nodejs Web Development
 
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...
 
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...
 
Dockerizing BDD : Ruby-Cucumber Example
Dockerizing BDD : Ruby-Cucumber ExampleDockerizing BDD : Ruby-Cucumber Example
Dockerizing BDD : Ruby-Cucumber Example
 
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
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With Selenium
 
OpenNTF Webinar May 2021 - Jesse
OpenNTF Webinar May 2021 - JesseOpenNTF Webinar May 2021 - Jesse
OpenNTF Webinar May 2021 - Jesse
 
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 ...
 
Dockercon EU 2015
Dockercon EU 2015Dockercon EU 2015
Dockercon EU 2015
 
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
 
Play! Framework for JavaEE Developers
Play! Framework for JavaEE DevelopersPlay! Framework for JavaEE Developers
Play! Framework for JavaEE Developers
 
Selenium-Grid-Extras
Selenium-Grid-ExtrasSelenium-Grid-Extras
Selenium-Grid-Extras
 
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
 
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
 
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
 
Intro
IntroIntro
Intro
 
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
 
Using Play Framework 2 in production
Using Play Framework 2 in productionUsing Play Framework 2 in production
Using Play Framework 2 in production
 
Don Wibier
Don WibierDon Wibier
Don Wibier
 
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
 

Ähnlich wie Automated ui-testing

Selenium- A Software Testing Tool
Selenium- A Software Testing ToolSelenium- A Software Testing Tool
Selenium- A Software Testing ToolZeba 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 everyoneTft Us
 
Selenium web driver_2.0_presentation
Selenium web driver_2.0_presentationSelenium web driver_2.0_presentation
Selenium web driver_2.0_presentationsayhi2sudarshan
 
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
 
How to use selenium successfully
How to use selenium successfullyHow to use selenium successfully
How to use selenium successfullyTEST 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 AutomationPakorn Weecharungsan
 
Selenium using Java
Selenium using JavaSelenium using Java
Selenium using JavaF K
 
Selenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep ShardaSelenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep ShardaEr. Sndp Srda
 

Ähnlich wie Automated ui-testing (20)

Selenium.pptx
Selenium.pptxSelenium.pptx
Selenium.pptx
 
Selenium- A Software Testing Tool
Selenium- A Software Testing ToolSelenium- A Software Testing Tool
Selenium- A Software Testing Tool
 
Introduction to selenium
Introduction to seleniumIntroduction to selenium
Introduction to selenium
 
Introduction to selenium
Introduction to seleniumIntroduction to selenium
Introduction to selenium
 
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 for everyone
Selenium for everyoneSelenium for everyone
Selenium for everyone
 
Selenium Topic 2 IDE
Selenium Topic 2 IDESelenium Topic 2 IDE
Selenium Topic 2 IDE
 
Selenium web driver_2.0_presentation
Selenium web driver_2.0_presentationSelenium web driver_2.0_presentation
Selenium web driver_2.0_presentation
 
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
 
How to use selenium successfully
How to use selenium successfullyHow to use selenium successfully
How to use selenium successfully
 
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...
 
Selenium – Web Browser Automation
Selenium – Web Browser AutomationSelenium – Web Browser Automation
Selenium – Web Browser Automation
 
Selenium presentation
Selenium presentationSelenium presentation
Selenium presentation
 
11-01-2023.pptx
11-01-2023.pptx11-01-2023.pptx
11-01-2023.pptx
 
Selenium using Java
Selenium using JavaSelenium using Java
Selenium using Java
 
Selenium
SeleniumSelenium
Selenium
 
Selenium
SeleniumSelenium
Selenium
 
Selenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep ShardaSelenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep Sharda
 
Selenium (1) (1)
Selenium (1) (1)Selenium (1) (1)
Selenium (1) (1)
 
Selenium
SeleniumSelenium
Selenium
 

Mehr von Slobodan Lohja

Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021Slobodan Lohja
 
Domino on docker version 2
Domino on docker version 2Domino on docker version 2
Domino on docker version 2Slobodan 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 XPagesSlobodan 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 rev2Slobodan Lohja
 
Domino on docker version 1
Domino on docker version 1Domino on docker version 1
Domino on docker version 1Slobodan Lohja
 
Git for IBM Notes Designer
Git for IBM Notes DesignerGit for IBM Notes Designer
Git for IBM Notes DesignerSlobodan Lohja
 

Mehr von Slobodan Lohja (7)

Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021
 
Domino on docker version 2
Domino on docker version 2Domino on docker version 2
Domino on docker version 2
 
Enable Domino Data Access Services (DAS)
Enable Domino Data Access Services (DAS)Enable Domino Data Access Services (DAS)
Enable Domino Data Access Services (DAS)
 
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
 
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
 
Domino on docker version 1
Domino on docker version 1Domino on docker version 1
Domino on docker version 1
 
Git for IBM Notes Designer
Git for IBM Notes DesignerGit for IBM Notes Designer
Git for IBM Notes Designer
 

Kürzlich hochgeladen

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 

Kürzlich hochgeladen (20)

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 

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: slohja@hotmail.com LinkedIn: linkedin.com/in/slobodanlohja/ Twitter: @xpagesbeast Automated UI Testing with Selenium

Hinweis der Redaktion

  1. 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.
  2. Automate on Mac, Linux, and Windows Automate in Java, Python, PHP, Ruby (flexibility) – designed for Java, and this demo is on Java
  3. 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
  4. 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
  5. 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.
  6. Maven is included in the latest Eclipse
  7. Maven is included in the latest Eclipse
  8. Maven is included in the latest Eclipse
  9. Maven is included in the latest Eclipse
  10. Maven is included in the latest Eclipse
  11. Maven is included in the latest Eclipse