SlideShare a Scribd company logo
1 of 26
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
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

Tema perfundimisht
Tema perfundimishtTema perfundimisht
Tema perfundimisht
Mustaf Ameti
 
Universiteti i prishtinës
Universiteti i prishtinësUniversiteti i prishtinës
Universiteti i prishtinës
Jeton Bytyqi
 
Bazat e menaxhimit
Bazat e menaxhimitBazat e menaxhimit
Bazat e menaxhimit
Menaxherat
 

Viewers also liked (18)

Matematike
MatematikeMatematike
Matematike
 
Publik transport- Prishtina
Publik transport- PrishtinaPublik transport- Prishtina
Publik transport- Prishtina
 
Funksioni
FunksioniFunksioni
Funksioni
 
Matematike e avancuar 1 FUNKSIONET
Matematike e avancuar 1 FUNKSIONETMatematike e avancuar 1 FUNKSIONET
Matematike e avancuar 1 FUNKSIONET
 
funksioni
funksioni funksioni
funksioni
 
Energjia e Eres
Energjia e EresEnergjia e Eres
Energjia e Eres
 
Hidrocentralet
HidrocentraletHidrocentralet
Hidrocentralet
 
Hsp matematik-tingkatan-2-bm
Hsp matematik-tingkatan-2-bmHsp matematik-tingkatan-2-bm
Hsp matematik-tingkatan-2-bm
 
Teme diplome Eduart Likollari.
Teme diplome Eduart Likollari. Teme diplome Eduart Likollari.
Teme diplome Eduart Likollari.
 
Punimi i temes MASTER - Viktimat e krimeve të vrasjeve me vështrim te posaçë...
Punimi i temes MASTER -  Viktimat e krimeve të vrasjeve me vështrim te posaçë...Punimi i temes MASTER -  Viktimat e krimeve të vrasjeve me vështrim te posaçë...
Punimi i temes MASTER - Viktimat e krimeve të vrasjeve me vështrim te posaçë...
 
teme diplome mirela cullhaj
teme diplome mirela cullhajteme diplome mirela cullhaj
teme diplome mirela cullhaj
 
Tema perfundimisht
Tema perfundimishtTema perfundimisht
Tema perfundimisht
 
Universiteti i prishtinës
Universiteti i prishtinësUniversiteti i prishtinës
Universiteti i prishtinës
 
Tema d iplomes nehat duraku
Tema d iplomes nehat durakuTema d iplomes nehat duraku
Tema d iplomes nehat duraku
 
Master Thesis Presentation
Master Thesis PresentationMaster Thesis Presentation
Master Thesis Presentation
 
MENAXHMENTI - Dr. Berim Ramosaj (Pyetje dhe përgjigje)
MENAXHMENTI - Dr. Berim Ramosaj (Pyetje dhe përgjigje)MENAXHMENTI - Dr. Berim Ramosaj (Pyetje dhe përgjigje)
MENAXHMENTI - Dr. Berim Ramosaj (Pyetje dhe përgjigje)
 
Projekti i matematikes
Projekti i matematikesProjekti i matematikes
Projekti i matematikes
 
Bazat e menaxhimit
Bazat e menaxhimitBazat e menaxhimit
Bazat e menaxhimit
 

Similar to Automated software testing using Selenium WebDriver

Selenium 2 for PHP(Unit)
Selenium 2 for PHP(Unit)Selenium 2 for PHP(Unit)
Selenium 2 for PHP(Unit)
AOE
 

Similar to Automated software testing using Selenium WebDriver (20)

Selenium for everyone
Selenium for everyoneSelenium for everyone
Selenium for everyone
 
[Rakuten TechConf2014] [Osaka] Introducing Selenium 2 WebDriver
[Rakuten TechConf2014] [Osaka] Introducing Selenium 2 WebDriver[Rakuten TechConf2014] [Osaka] Introducing Selenium 2 WebDriver
[Rakuten TechConf2014] [Osaka] Introducing Selenium 2 WebDriver
 
Manual JavaScript Analysis Is A Bug
Manual JavaScript Analysis Is A BugManual JavaScript Analysis Is A Bug
Manual JavaScript Analysis Is A Bug
 
Selenium presentation
Selenium presentationSelenium presentation
Selenium presentation
 
Browser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.jsBrowser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.js
 
Selenium training
Selenium trainingSelenium training
Selenium training
 
Selenium IDE and Beyond
Selenium IDE and BeyondSelenium IDE and Beyond
Selenium IDE and Beyond
 
Selenium 101 Webinar
Selenium 101 WebinarSelenium 101 Webinar
Selenium 101 Webinar
 
Automated Testing on Web Applications
Automated Testing on Web ApplicationsAutomated Testing on Web Applications
Automated Testing on Web Applications
 
Akash 2013CA05 software testing presentation -selenium
Akash 2013CA05 software testing presentation  -seleniumAkash 2013CA05 software testing presentation  -selenium
Akash 2013CA05 software testing presentation -selenium
 
DevOops Redux Ken Johnson Chris Gates - AppSec USA 2016
DevOops Redux Ken Johnson Chris Gates  - AppSec USA 2016DevOops Redux Ken Johnson Chris Gates  - AppSec USA 2016
DevOops Redux Ken Johnson Chris Gates - AppSec USA 2016
 
Automated Acceptance Testing from Scratch
Automated Acceptance Testing from ScratchAutomated Acceptance Testing from Scratch
Automated Acceptance Testing from Scratch
 
The Diabolical Developer's Guide to Surviving Java 9
The Diabolical Developer's Guide to Surviving Java 9The Diabolical Developer's Guide to Surviving Java 9
The Diabolical Developer's Guide to Surviving Java 9
 
Selenium 2 for PHP(Unit)
Selenium 2 for PHP(Unit)Selenium 2 for PHP(Unit)
Selenium 2 for PHP(Unit)
 
OWASP 2014 AppSec EU ZAP Advanced Features
OWASP 2014 AppSec EU ZAP Advanced FeaturesOWASP 2014 AppSec EU ZAP Advanced Features
OWASP 2014 AppSec EU ZAP Advanced Features
 
KrishnaToolComparisionPPT.pdf
KrishnaToolComparisionPPT.pdfKrishnaToolComparisionPPT.pdf
KrishnaToolComparisionPPT.pdf
 
Selenium.pptx
Selenium.pptxSelenium.pptx
Selenium.pptx
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - Introduction
 
Automated ui-testing
Automated ui-testingAutomated ui-testing
Automated ui-testing
 
JavaOne 2016 - CON3080 - Testing Java Web Applications with Selenium: A Cookbook
JavaOne 2016 - CON3080 - Testing Java Web Applications with Selenium: A CookbookJavaOne 2016 - CON3080 - Testing Java Web Applications with Selenium: A Cookbook
JavaOne 2016 - CON3080 - Testing Java Web Applications with Selenium: A Cookbook
 

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
  • 20.
  • 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)