SlideShare a Scribd company logo
Automated software testing
using Selenium WebDriver
(Testimi i automatizuar i software-it
tuj’ përdorë Selenium WebDriver)
Kush o’ ky djal??
• Kush? – Ilir Sadik Kosumi
• Qka? (titujt)
1. “Njeri”
2. “Senior” Software Tester (QA)
3. PhD. n’lëminë e sarkazmit
4. Proud Gamer
5. Edhe plot tituj tjer’ që s’i nxen sllajdi (...qe spo m’bin n’men)
• Qa ka t’kryme? – Inxhinieri Mekanike, n’Teknik – UP
• Social
– Twitter: @ilirkosumi
– Goodreads: https://www.goodreads.com/user/show/26042912-ilir-kosumi
– GitHub: https://github.com/illyric
– Steam: http://steamcommunity.com/id/illyricanking
• Fjalia e urtë e preferuar:
“ If A is success in life, then A = x + y + z
x is work,
y is play, and
Z is keeping your mouth shut. ”
– Albert Einstein
Unë jom k’tu për me fol, ju jeni për me
ndegju!1
1 Po rrej!
No one in the brief history of computing has
ever written a piece of perfect software.
― Andrew Hunt,
The Pragmatic Programmer: From Journeyman to Master
What is Software Testing
(and why it rocks)?
• Most people think it’s just running test (by
executing software). This is one part of testing,
but not the big picture!
• Process: Testing is a process rather than a single
activity.
• Software testing shows the presence of bugs. It
does not show that there are none. (1st testing
principle in the Holy book of ISTQB Foundation
Level Sylabus)
• Testing Software is sometimes fun (esp. when you
find critical bugs)
How I see myself as a Software Tester
How devs (usually) see Software
Testers
Would you press the button?
Would you press the button? (2)
Regression Testing – Long live test
automation!
• Regression testing is a way of re-testing what
you already know should work (because there
was an update in the system-under-test that
might have affected the stuff you tested it in
the past which you knew did work back then)
• Manual regression testing is the most boring
task in Software Testing!
• As a software tester, test automation saves
not only my day but also my nerves...
Selenium
• Selenium ≠ testing tool
• Selenium is more like an open-source
community where everyone can contribute,
an organization (like Mozilla), a philosophy
etc.
• WebDriver = open-source testing tool that
automates/simulates user interactions with
the werb-browser
A brief history of Selenium
(na ishte njehere...)
• Started in 2004 at
ThoughtWorks in Chicago
• Jason Huggins – first started
selenium
• Selenium 1 (RC)
• Selenium 2 (WebDriver)
• The name, Selenium, was
selected because selenium
mineral supplements serve
as a cure for mercury
poisoning, Huggins
explained.*
*http://www.techworld.com/news/apps/open-source-selenium-web-app-test-suite-to-support-iphone-and-android-3272444/
Selenium 1 (RC - Remote Control)
• UI automation library, allowing developers and
testers to automate their interactions with a Web
Application Under Test (WAUT) by providing
them with the necessary libraries, supported in
multiple languages, to program.
• Generic JavaScript named Selenium Core to drive
the WAUT on a browser
• Selense commands
• Same-Origin Policy ☹
Selenium RC diagram (2)
Selenium 2 (WebDriver)
• WebDriver has come into existence for the
following reasons:
– Give a better control on the browser by
implementing browser-specifi
implementations.
– To give a better programming experience to the
developer by adhering more
closely to the object-oriented programming
fundamentals
WebDriver Implementations
• FirefoxDriver
• ChromeDriver
• SafariDriver
• AndroidDriver & IphoneDriver (Appium)
• HtmlUnitDriver
• InternetExplorerDriver
Selenium WebDriver diagram
Download WebDriver
• Download all jar files and add include them in
your project classpath as .jar dependencies
• If you use maven, you can add the maven
dependencies to get WebDriver
Maven dependencies2
• All dependencies:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.46.0</version>
</dependency>
• Browser-specific dependencies (ex. Firefox Driver):
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-firefox-driver</artifactId>
<version>2.46.0</version>
</dependency>
2 Thanks to Modest for presenting maven: http://prijug.org/?p=12&lang=en
Automated software testing using Selenium WebDriver
Googling “Google” (manually)
• TC1 – Googling Google:
– Precondition:
• User has internet access
• User has an internet browser (preferably Firefox, or Chrome... In this example we are using
Firefox)
– Steps
1. Launch Firefox
2. Navigate to “http://www.google.com/”
3. Enter “the Google search engin” in the search textbox and search
– Expected results:
• User will see the correct spelling of the word “engine” preceded by “Showing results for the
Google search”
• User will see “Google Search - Wikipedia, the free encyclopedia” as the first search result
• The title of the Firefox browser window will show “the Google search engin – Google
Search”
• User will see on the left side a side-meny with the title “Google” and a brief description of
the company
Googling “Google” (automated)
LET’S GET OUR HANDS DIRTY!
What could go wrong?
• Improper resource
staffing
• Taking shortcuts***
• Abandoning
documentation
• A fool with a tool is still
a fool
References
• Selenium website: http://www.seleniumhq.org/
• The Pragmatic Programmer: From Journeyman to Master - Andrew Hunt: http://www.amazon.com/The-
Pragmatic-Programmer-Journeyman-Master/dp/020161622X
• Selenium WebDriver Practical Guide – Satya Avasarala: https://www.packtpub.com/web-development/selenium-
webdriver-practical-guide
• ISTQB Foundation Level Sylabus: http://www.istqb.org/downloads/finish/16/15.html
• (Good Old) Wikipedia:
– https://en.wikipedia.org/wiki/Software_testing
– https://en.wikipedia.org/wiki/Selenium_(software)
• Techworld.com: http://www.techworld.com/news/apps/open-source-selenium-web-app-test-suite-to-support-
iphone-and-android-3272444/
• Appium: http://appium.io/index.html?lang=en
• PriJUG maven meetup: http://prijug.org/?p=12&lang=en
• GitHub project: https://github.com/illyric/selenium-presantation-demo
• Pictures:
– http://www.dumpaday.com/wp-content/uploads/2014/01/sarcasm-3.jpg
– http://pubs.usgs.gov/of/2006/1184/1184.jpg
– http://2.bp.blogspot.com/-H77MQZVhxw8/T0JNCjiqo_I/AAAAAAAAAco/-YzaIT2rDH4/s1600/124+How+a+developer+feels.png
– https://upload.wikimedia.org/wikipedia/commons/8/8e/The_Big_Red_Button_(3085157011).jpg
– http://www.instantcheckmate.com/crimewire/wp-content/uploads/2013/05/DIY-Investigating-On-Reddit.jpg
– https://maribiella.files.wordpress.com/2014/05/signpost.jpg
– http://freedompreneur.com/wp-content/uploads/2014/07/upside-down-rocket.jpg
– http://www.sindhud.info/files/2009-11-25-webdriver/api-uml.png
Thank you for your attention!
(rrehni shuplaka se u kry)

More Related Content

Viewers also liked (16)

PPTX
Matematike
Driton16
 
PDF
Publik transport- Prishtina
Ermal Sylejmani
 
DOCX
Matematike e avancuar 1 FUNKSIONET
Xhoana Pepa
 
DOCX
Energjia e Eres
dritan sadikaj
 
PPTX
Hidrocentralet
Ergi Nushi
 
PDF
Hsp matematik-tingkatan-2-bm
Herney Mohamed
 
PDF
Teme diplome Eduart Likollari.
Eduart Likollari
 
PDF
Punimi i temes MASTER - Viktimat e krimeve të vrasjeve me vështrim te posaçë...
Flamur Troni
 
PDF
teme diplome mirela cullhaj
Mirelacullhaj
 
DOC
Tema perfundimisht
Mustaf Ameti
 
DOCX
Universiteti i prishtinës
Jeton Bytyqi
 
DOC
Tema d iplomes nehat duraku
Nehat Duraku
 
PPTX
Master Thesis Presentation
Ermal Sylejmani
 
PDF
MENAXHMENTI - Dr. Berim Ramosaj (Pyetje dhe përgjigje)
fatonbajrami1
 
DOCX
Projekti i matematikes
Ismail Dama
 
DOC
Bazat e menaxhimit
Menaxherat
 
Matematike
Driton16
 
Publik transport- Prishtina
Ermal Sylejmani
 
Matematike e avancuar 1 FUNKSIONET
Xhoana Pepa
 
Energjia e Eres
dritan sadikaj
 
Hidrocentralet
Ergi Nushi
 
Hsp matematik-tingkatan-2-bm
Herney Mohamed
 
Teme diplome Eduart Likollari.
Eduart Likollari
 
Punimi i temes MASTER - Viktimat e krimeve të vrasjeve me vështrim te posaçë...
Flamur Troni
 
teme diplome mirela cullhaj
Mirelacullhaj
 
Tema perfundimisht
Mustaf Ameti
 
Universiteti i prishtinës
Jeton Bytyqi
 
Tema d iplomes nehat duraku
Nehat Duraku
 
Master Thesis Presentation
Ermal Sylejmani
 
MENAXHMENTI - Dr. Berim Ramosaj (Pyetje dhe përgjigje)
fatonbajrami1
 
Projekti i matematikes
Ismail Dama
 
Bazat e menaxhimit
Menaxherat
 

Similar to Automated software testing using Selenium WebDriver (20)

PPTX
Automated ui-testing
Slobodan Lohja
 
PPTX
Step by step - Selenium 3 web-driver - From Scratch
Haitham Refaat
 
PDF
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
jamescantor38
 
PDF
How To Use Selenium Successfully (Java Edition)
Dave Haeffner
 
PDF
Selenium - Introduction
Amr E. Mohamed
 
PPTX
Automation With Selenium
kgrammer
 
PPTX
Selenium Basics and Overview topics.pptx
sountharyaravi010
 
PPTX
Selenium Basics and Overview1233444.pptx
sountharyaravi010
 
PPTX
Selenium Automation
Anuradha Malalasena
 
PDF
Web UI test automation instruments
Artem Nagornyi
 
PPTX
A Definitive Guide to Mastering Selenium WebDriver Automation Effectively.pptx
Matthew Allen
 
PPTX
Selenium web driver
Roman Savitskiy
 
PDF
Selenium course training institute ameerpet hyderabad – Best software trainin...
Sathya Technologies
 
PDF
Selenium course training institute ameerpet hyderabad
Sathya Technologies
 
PDF
How To Use Selenium Successfully
Dave Haeffner
 
PDF
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Dave Haeffner
 
PDF
Web automation using selenium.ppt
Ana Sarbescu
 
PDF
Selenium for Tester.pdf
RTechRInfoIT
 
PPTX
Selenium web driver
Sun Technlogies
 
PPTX
Selenium.pptx
Pandiya Rajan
 
Automated ui-testing
Slobodan Lohja
 
Step by step - Selenium 3 web-driver - From Scratch
Haitham Refaat
 
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
jamescantor38
 
How To Use Selenium Successfully (Java Edition)
Dave Haeffner
 
Selenium - Introduction
Amr E. Mohamed
 
Automation With Selenium
kgrammer
 
Selenium Basics and Overview topics.pptx
sountharyaravi010
 
Selenium Basics and Overview1233444.pptx
sountharyaravi010
 
Selenium Automation
Anuradha Malalasena
 
Web UI test automation instruments
Artem Nagornyi
 
A Definitive Guide to Mastering Selenium WebDriver Automation Effectively.pptx
Matthew Allen
 
Selenium web driver
Roman Savitskiy
 
Selenium course training institute ameerpet hyderabad – Best software trainin...
Sathya Technologies
 
Selenium course training institute ameerpet hyderabad
Sathya Technologies
 
How To Use Selenium Successfully
Dave Haeffner
 
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Dave Haeffner
 
Web automation using selenium.ppt
Ana Sarbescu
 
Selenium for Tester.pdf
RTechRInfoIT
 
Selenium web driver
Sun Technlogies
 
Selenium.pptx
Pandiya Rajan
 
Ad

Automated software testing using Selenium WebDriver

  • 1. Automated software testing using Selenium WebDriver (Testimi i automatizuar i software-it tuj’ përdorë Selenium WebDriver)
  • 2. Kush o’ ky djal?? • Kush? – Ilir Sadik Kosumi • Qka? (titujt) 1. “Njeri” 2. “Senior” Software Tester (QA) 3. PhD. n’lëminë e sarkazmit 4. Proud Gamer 5. Edhe plot tituj tjer’ që s’i nxen sllajdi (...qe spo m’bin n’men) • Qa ka t’kryme? – Inxhinieri Mekanike, n’Teknik – UP • Social – Twitter: @ilirkosumi – Goodreads: https://www.goodreads.com/user/show/26042912-ilir-kosumi – GitHub: https://github.com/illyric – Steam: http://steamcommunity.com/id/illyricanking • Fjalia e urtë e preferuar: “ If A is success in life, then A = x + y + z x is work, y is play, and Z is keeping your mouth shut. ” – Albert Einstein
  • 3. Unë jom k’tu për me fol, ju jeni për me ndegju!1 1 Po rrej!
  • 4. No one in the brief history of computing has ever written a piece of perfect software. ― Andrew Hunt, The Pragmatic Programmer: From Journeyman to Master
  • 5. What is Software Testing (and why it rocks)? • Most people think it’s just running test (by executing software). This is one part of testing, but not the big picture! • Process: Testing is a process rather than a single activity. • Software testing shows the presence of bugs. It does not show that there are none. (1st testing principle in the Holy book of ISTQB Foundation Level Sylabus) • Testing Software is sometimes fun (esp. when you find critical bugs)
  • 6. How I see myself as a Software Tester
  • 7. How devs (usually) see Software Testers
  • 8. Would you press the button?
  • 9. Would you press the button? (2)
  • 10. Regression Testing – Long live test automation! • Regression testing is a way of re-testing what you already know should work (because there was an update in the system-under-test that might have affected the stuff you tested it in the past which you knew did work back then) • Manual regression testing is the most boring task in Software Testing! • As a software tester, test automation saves not only my day but also my nerves...
  • 11. Selenium • Selenium ≠ testing tool • Selenium is more like an open-source community where everyone can contribute, an organization (like Mozilla), a philosophy etc. • WebDriver = open-source testing tool that automates/simulates user interactions with the werb-browser
  • 12. A brief history of Selenium (na ishte njehere...) • Started in 2004 at ThoughtWorks in Chicago • Jason Huggins – first started selenium • Selenium 1 (RC) • Selenium 2 (WebDriver) • The name, Selenium, was selected because selenium mineral supplements serve as a cure for mercury poisoning, Huggins explained.* *http://www.techworld.com/news/apps/open-source-selenium-web-app-test-suite-to-support-iphone-and-android-3272444/
  • 13. Selenium 1 (RC - Remote Control) • UI automation library, allowing developers and testers to automate their interactions with a Web Application Under Test (WAUT) by providing them with the necessary libraries, supported in multiple languages, to program. • Generic JavaScript named Selenium Core to drive the WAUT on a browser • Selense commands • Same-Origin Policy ☹
  • 15. Selenium 2 (WebDriver) • WebDriver has come into existence for the following reasons: – Give a better control on the browser by implementing browser-specifi implementations. – To give a better programming experience to the developer by adhering more closely to the object-oriented programming fundamentals
  • 16. WebDriver Implementations • FirefoxDriver • ChromeDriver • SafariDriver • AndroidDriver & IphoneDriver (Appium) • HtmlUnitDriver • InternetExplorerDriver
  • 18. Download WebDriver • Download all jar files and add include them in your project classpath as .jar dependencies • If you use maven, you can add the maven dependencies to get WebDriver
  • 19. Maven dependencies2 • All dependencies: <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>2.46.0</version> </dependency> • Browser-specific dependencies (ex. Firefox Driver): <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-firefox-driver</artifactId> <version>2.46.0</version> </dependency> 2 Thanks to Modest for presenting maven: http://prijug.org/?p=12&lang=en
  • 21. Googling “Google” (manually) • TC1 – Googling Google: – Precondition: • User has internet access • User has an internet browser (preferably Firefox, or Chrome... In this example we are using Firefox) – Steps 1. Launch Firefox 2. Navigate to “http://www.google.com/” 3. Enter “the Google search engin” in the search textbox and search – Expected results: • User will see the correct spelling of the word “engine” preceded by “Showing results for the Google search” • User will see “Google Search - Wikipedia, the free encyclopedia” as the first search result • The title of the Firefox browser window will show “the Google search engin – Google Search” • User will see on the left side a side-meny with the title “Google” and a brief description of the company
  • 23. LET’S GET OUR HANDS DIRTY!
  • 24. What could go wrong? • Improper resource staffing • Taking shortcuts*** • Abandoning documentation • A fool with a tool is still a fool
  • 25. References • Selenium website: http://www.seleniumhq.org/ • The Pragmatic Programmer: From Journeyman to Master - Andrew Hunt: http://www.amazon.com/The- Pragmatic-Programmer-Journeyman-Master/dp/020161622X • Selenium WebDriver Practical Guide – Satya Avasarala: https://www.packtpub.com/web-development/selenium- webdriver-practical-guide • ISTQB Foundation Level Sylabus: http://www.istqb.org/downloads/finish/16/15.html • (Good Old) Wikipedia: – https://en.wikipedia.org/wiki/Software_testing – https://en.wikipedia.org/wiki/Selenium_(software) • Techworld.com: http://www.techworld.com/news/apps/open-source-selenium-web-app-test-suite-to-support- iphone-and-android-3272444/ • Appium: http://appium.io/index.html?lang=en • PriJUG maven meetup: http://prijug.org/?p=12&lang=en • GitHub project: https://github.com/illyric/selenium-presantation-demo • Pictures: – http://www.dumpaday.com/wp-content/uploads/2014/01/sarcasm-3.jpg – http://pubs.usgs.gov/of/2006/1184/1184.jpg – http://2.bp.blogspot.com/-H77MQZVhxw8/T0JNCjiqo_I/AAAAAAAAAco/-YzaIT2rDH4/s1600/124+How+a+developer+feels.png – https://upload.wikimedia.org/wikipedia/commons/8/8e/The_Big_Red_Button_(3085157011).jpg – http://www.instantcheckmate.com/crimewire/wp-content/uploads/2013/05/DIY-Investigating-On-Reddit.jpg – https://maribiella.files.wordpress.com/2014/05/signpost.jpg – http://freedompreneur.com/wp-content/uploads/2014/07/upside-down-rocket.jpg – http://www.sindhud.info/files/2009-11-25-webdriver/api-uml.png
  • 26. Thank you for your attention! (rrehni shuplaka se u kry)