SlideShare a Scribd company logo
Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Selenium | Simplilearn
What is Selenium?
What’s in it for you?
What is Selenium?
Why Selenium WebDriver?
What’s in it for you?
What is Selenium?
Why Selenium WebDriver?
What is Selenium
WebDriver?
What’s in it for you?
What is Selenium?
Why Selenium WebDriver?
What is Selenium
WebDriver?
Architecture of Selenium
WebDriver
What’s in it for you?
What’s in it for you?
What is Selenium?
Why Selenium WebDriver?
What is Selenium
WebDriver?
Architecture of Selenium
WebDriver
Limitations of Selenium
WebDriver
What’s in it for you?
What is Selenium?
Why Selenium WebDriver?
What is Selenium
WebDriver?
Architecture of Selenium
WebDriver
Demo: Automation testing
with WebDriver
Limitations of Selenium
WebDriver
What is Selenium?
Advent of Selenium
Why can’t I test for the
performance
No good scope eitherSo many errors!
Time consuming
Conventional manual testing has several
drawbacks and is extremely monotonous
Drawbacks of Manual Testing
Time consuming
Drawbacks of Manual Testing
Error-prone
Time consuming
Drawbacks of Manual Testing
Limited scope for testingError prone
Time consuming
Drawbacks of Manual Testing
Time consuming
Why can’t I test for
the performance??
Limited scope for testingError prone
Advent of Selenium
Why can’t I test for the
performance
No good scope eitherSo many errors!
Time consuming
Selenium originated in 2004 -
as a tool for testing web
applications
Advent of Selenium
Why can’t I test for the
performance
No good scope eitherSo many errors!
Time consuming
Selenium originated in 2004 -
as a tool for testing web
applications
It was developed by Jason
Huggins, a programmer at
ThoughtWorks
Advent of Selenium
Why can’t I test for the
performance
No good scope eitherSo many errors!
Time consuming
Selenium originated in 2004 -
as a tool for testing web
applications
It was developed by Jason
Huggins, a programmer at
ThoughtWorks
It competed against other automation
testing tools like QTP (Quick test
Professional) developed by HP and
RFT(Rational functional tester)
developed by IBM
Advent of Selenium
Why can’t I test for the
performance
No good scope eitherSo many errors!
Time consuming
Selenium originated in 2004 -
as a tool for testing web
applications
It was developed by Jason
Huggins, a programmer at
ThoughtWorks
It competed against other automation
testing tools like QTP (Quick test
Professional) developed by HP and
RFT(Rational functional tester)
developed by IBM
Selenium was developed as
JavaScriptTestRunner
and evolved over years as a powerful
automated testing tool
Widely used automation testing tool
What is Selenium?
Widely used automation testing tool
Tests web applications across various browsers
What is Selenium?
Widely used automation testing tool
Tests web applications across various browsers
Consists of a set of software tools that facilitate testing
What is Selenium?
Widely used automation testing tool
Tests web applications across various browsers
Consists of a set of software tools that facilitate testing
Platform independent and open source
What is Selenium?
Selenium is primarily developed in Java Script
What is Selenium?
Selenium is primarily developed in Java Script
It provides a record/playback tool for authoring tests without learning a test scripting
language
What is Selenium?
Selenium is primarily developed in Java Script
It provides a record/playback tool for authoring tests without learning a test scripting
language
The tests can also be coded in a number of popular programming languages
What is Selenium?
Selenium is primarily developed in Java Script
It provides a record/playback tool for authoring tests without learning a test scripting
language
Selenium can be deployed on Windows, Linux, and Macintosh
What is Selenium?
The tests can also be coded in a number of popular programming languages
Selenium suite
Selenium IDE
Selenium test
suite
Browser plugin that records
user actions and exports them
as a reusable script
Selenium
suite
Selenium suite
Selenium IDE Selenium RC
Selenium test
suite
• Multi-programming and multi
browser support
• Deprecated in Selenium 2
Browser plugin that records
user actions and exports them
as a reusable script
Selenium
suite
Selenium suite
Selenium IDE Selenium RC
Selenium
WebDriver
Selenium test
suite
Browser plugin that records
user actions and exports them
as a reusable script
• Uses APIs to interact with the
browser
• Successor of Selenium RC
• Multi-programming and multi
browser support
• Deprecated in Selenium 2
Selenium
suite
Selenium suite
Selenium IDE Selenium RC
Selenium
WebDriver
Selenium
Grid
Selenium test
suite
Browser plugin that records
user actions and exports them
as a reusable script
• Runs multiple tests against
different browsers.
• Capable of running tests in
parallel
• Uses APIs to interact with the
browser
• Successor of Selenium RC
• Multi-programming and multi
browser support
• Deprecated in Selenium 2
Selenium
suite
Selenium suite
Selenium 1
Selenium 2
Selenium 3
Selenium 4
Selenium IDE Selenium RC Grid
Selenium IDE *Selenium RC Grid
Selenium IDE
Selenium
WebDriver
Grid
Selenium
WebDriver
Version 4 is just around the corner. However, Alpha has been released!
Why Selenium WebDriver?
Let’s first discuss Selenium RC
and its shortcomings
Working principle of Selenium RC
Selenium Remote Control (RC) is a test tool that allows you to write
automated web application UI tests in any programming language
against any HTTP website using any mainstream JavaScript-enabled
browser.
Selenium test script RC server Web browser Web server
Test script written in any programming language like
JAVA, PHP, Python etc.
Working principle of Selenium RC
Selenium test script RC server Web browser Web server
Selenium Server receives Selenium commands from
your test program, interprets them, and reports the
results back to the program
Working principle of Selenium RC
Selenium test script RC server Web browser Web server
The Web browser is injected with Selenium core which
interprets and executes the Selenese commands used in
the test script
Working principle of Selenium RC
Selenium test script RC server Web browser Web server
The Web browser can now interact with the web server
accordingly
Working principle of Selenium RC
Selenium test script RC Server Web browser Web server
RC consists of an additional server that
acts as a middle man
This additional setup complicates the
architecture
The time taken for execution of
commands is longer
Shortcomings of Selenium RC
How does Selenium WebDriver
overcome this?
Selenium test script
Selenium WebDriver
Web browser Web server
Selenium test script
Selenium WebDriver
Web serverWeb browser
Selenium-WebDriver does not use an
additional server
It makes direct calls to the browser using
each browser’s native support for
automation
The execution time for commands is
shorter due to the simple architecture
A single function has
several commands
Selenium RC
APIs in Selenium RC
A single function has
several commands
Selenium RC
APIs in Selenium RC
Redundant &
confusing APIs
A single function has
several commands
Selenium RC
APIs in Selenium RC
Redundant &
confusing APIs
A single function has
several commands
Selenium RC
APIs in Selenium RC
Redundant &
confusing APIs
Different browsers
interpret different
commands differently
A single function has
several commands
Selenium RC
APIs in Selenium RC
Redundant &
confusing APIs
Different browsers
interpret different
commands differently
Selenium WebDriver
A single function has
several commands
Selenium RC
APIs in Selenium RC
Redundant &
confusing APIs
Different browsers
interpret different
commands differently
Selenium WebDriver
Simple and easy to
remember
A single function has
several commands
Selenium RC
APIs in Selenium RC
Redundant &
confusing APIs
Different browsers
interpret different
commands differently
Selenium WebDriver
No Redundant
commands
Simple and easy to
remember
A single function has
several commands
Selenium RC
APIs in Selenium RC
Redundant &
confusing APIs
No Redundant
commands
Simple and easy to
remember
Different browsers
interpret different
commands differently
Selenium WebDriver
Browser support in Selenium RC
Requires a real browser to
operate on
Does not support HtmlUnit
browser
No time spent in loading web
elements
Supports a headless, GUI-less
HtmlUnit browser
Selenium WebDriverSelenium RC
Browser support in Selenium WebDriver
Requires a real browser to
operate on
Does not support HtmlUnit
browser
No time spent in loading web
elements
Supports a headless, GUI-less
HtmlUnit browser
Selenium RC Selenium WebDriver
Simple architecture
Faster execution
Interacts directly with
the browser
Easy to use APIs
Support for HtmlUnit
browser
Complex architecture
Slower execution
Requires an RC
server to interact with
the browser
Confusing APIs
No support for
HtmlUnit browser
To summarize…
Selenium
WebDriverSelenium RC
What is Selenium WebDriver?
What is Selenium WebDriver?
Selenium WebDriver is a tool that
runs automated tests across
different browsers
What is Selenium WebDriver?
What is Selenium WebDriver?
Founded by Simon Stewart in 2006
What is Selenium WebDriver?
Founded by Simon Stewart in 2006
It is a cross platform testing framework
Founded by Simon Stewart in 2006
It is a cross platform testing framework
Programming interface to create and run test cases
What is Selenium WebDriver?
What is Selenium WebDriver?
Founded by Simon Stewart in 2006
It is a cross platform testing framework
Programming interface to create and run test cases
Makes provision to perform action on web elements
What is Selenium WebDriver?
Founded by Simon Stewart in 2006
It is a cross platform testing framework
Programming interface to create and run test cases
Makes provision to perform action on web elements
Does not require a core engine like RC and interacts natively with the
browser applications
What is Selenium WebDriver?
Founded by Simon Stewart in 2006
It is a cross platform testing framework
Programming interface to create and run test cases
Makes provision to perform action on web elements
Does not require a core engine like RC and interacts natively with the
browser applications
Supports Java, C#, PHP, Python, Perl, Ruby etc.
What is Selenium WebDriver?
Founded by Simon Stewart in 2006
It is a cross platform testing framework
Programming interface to create and run test cases
Makes provision to perform action on web elements
Does not require a core engine like RC and interacts natively with the
browser applications
Supports Java, C#, PHP, Python, Perl, Ruby etc.
Supports frameworks like TestNG, JUnit, NUnit
rchitecture of Selenium WebDriver
JSON Wire Protocol
Browsers
• Chrome browser
• Firefox browser
• Opera browser
• Safari browser
• Edge browser
Http over Http Server
Browser Drivers
• ChromeDriver
• FirefoxDriver
• OperaDriver
• SafariDriver
• EdgeDriver
Http over Http Server
Architecture of Selenium WebDriver
Selenium test script
(Java, PHP, Perl…)
Selenium test script is the test code written in any of
the mentioned programming languages that is
interpreted by the driver
Browsers
• Chrome browser
• Firefox browser
• Opera browser
• Safari browser
• Edge browser
Browser Drivers
• ChromeDriver
• FirefoxDriver
• OperaDriver
• SafariDriver
• EdgeDriver
Http over Http Server
Http over Http Server
Architecture of Selenium WebDriver
Selenium test script
(Java, PHP, Perl…)
JSON Wire Protocol
JSON Wire Protocol provides a transport mechanism
to transfer data between a server and a client. JSON
Wire Protocol serves as an industry standard for
various web services
Browsers
• Chrome browser
• Firefox browser
• Opera browser
• Safari browser
• Edge browser
Http over Http Server
Http over Http Server
Architecture of Selenium WebDriver
Selenium test script
(Java, PHP, Perl…)
JSON Wire Protocol
Browser Drivers
• ChromeDriver
• FirefoxDriver
• OperaDriver
• SafariDriver
• EdgeDriver
Selenium uses drivers, specific to each browser in
order to establish a secure connection with the
browser
Architecture of Selenium WebDriver
Selenium test script
(Java, PHP, Perl…)
JSON Wire Protocol
Browser Drivers
• ChromeDriver
• FirefoxDriver
• OperaDriver
• SafariDriver
• EdgeDriver
Browsers
• Chrome browser
• Firefox browser
• Opera browser
• Safari browser
• Edge browser
Http over Http Server
Http over Http Server
Selenium WebDriver supports various web browsers
to test and run applications on
imitations of Selenium WebDriver
Cannot handle
pop-ups and
advertisement
windows
Limitations of WebDriver
Cannot test mobile
applications. Requires
frameworks like Appium
Cannot handle
pop-ups and
advertisement
windows
Limitations of WebDriver
Cannot test mobile
applications. Requires
frameworks like Appium
Can only perform
sequential testing
hence requires Grid
for parallel testing
Cannot handle
pop-ups and
advertisement
windows
Limitations of WebDriver
Cannot test mobile
applications. Requires
frameworks like Appium
Can only perform
sequential testing
hence requires Grid
for parallel testing
Limited reporting.
Third party tools like
TestNG are required
CrossBrowserTesting
Cannot handle
pop-ups and
advertisement
windows
Limitations of WebDriver
Cannot test mobile
applications. Requires
frameworks like Appium
Can only perform
sequential testing
hence requires Grid
for parallel testing
Limited reporting.
Third party tools like
TestNG are required
CrossBrowserTesting
Limited image testing
Demo: Automation testing using
WebDriver
Browser APIs and their usage
Get Commands
driver.get(“https://www.google.co.in”);
driver.getTitle();
driver.getCurrentUrl();
driver.getPageSource();
driver.getWindowHandle();
driver.getWindowHandles();
Navigation Commands
driver.navigate().to("https://www.ebay.in/");
driver.navigate().back();
driver.navigate().forward();
driver.navigate().refresh();
Locator Commands
driver.findElement(By.id(“user”));
driver.findElement(By.linkText(“click here”));
driver.findElement(By.name(“admin”));
driver.findElement(By.className(“main-container”));
driver.findElement(By.cssSelector(“#primary”));
driver.findElement(By.xpath(“//*[@id="primary"]”));
Browser Commands
driver.close()
Closes the current browser window
driver.quit()
Quits the entire browser session
Demo Use case
Usecase 1 : As a user, I want to login to ebay.in and search for “JBL Speakers”
Then I want to check the day’s deals
Usecase 2 : From ebay.in, navigate to Simplilearn website. And navigate back to ebay.in
Usecase 3: From ebay.in, I want to print the page title and close the browser
Key takeaways
Key Takeaways
• What is Selenium
• Limitations of Selenium RC and how WebDriver overcomes it
• What is Selenium WebDriver?
• Architecture of Selenium WebDriver
• Limitations of Selenium WebDriver
• Browser APIs and their usage

More Related Content

PPTX
What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...
PPTX
An overview of selenium webdriver
PPT
QSpiders - Automation using Selenium
PPTX
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
PPT
Selenium Presentation at Engineering Colleges
PPTX
Selenium test automation
PPTX
Introduction to Selenium Web Driver
PPTX
Automation Testing by Selenium Web Driver
What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...
An overview of selenium webdriver
QSpiders - Automation using Selenium
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Presentation at Engineering Colleges
Selenium test automation
Introduction to Selenium Web Driver
Automation Testing by Selenium Web Driver

What's hot (20)

PPTX
Test Automation and Selenium
PPT
Selenium
PDF
Introduction to Selenium Automation
PPT
Selenium Concepts
PPTX
Selenium WebDriver training
PPTX
Automation - web testing with selenium
PDF
Automation Testing using Selenium
PPTX
Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...
PPTX
Test automation using selenium
PPTX
Selenium
PDF
Angular material
PDF
Selenium IDE LOCATORS
PPTX
Test Automation Using Selenium
PPTX
Python selenium
ODP
Test Automation Framework using Cucumber BDD overview (part 1)
PPTX
Selenium with java
PDF
SELENIUM PPT.pdf
PDF
Selenium with Cucumber
PPTX
Selenium- A Software Testing Tool
PDF
Webdriver io presentation
Test Automation and Selenium
Selenium
Introduction to Selenium Automation
Selenium Concepts
Selenium WebDriver training
Automation - web testing with selenium
Automation Testing using Selenium
Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...
Test automation using selenium
Selenium
Angular material
Selenium IDE LOCATORS
Test Automation Using Selenium
Python selenium
Test Automation Framework using Cucumber BDD overview (part 1)
Selenium with java
SELENIUM PPT.pdf
Selenium with Cucumber
Selenium- A Software Testing Tool
Webdriver io presentation
Ad

Similar to Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Selenium | Simplilearn (20)

PPTX
PPTX
Selenium introduction
PPTX
Introduction to selenium
PPTX
Selenium introduction
PPTX
test-automation-selenium-160216124839.pptx
PPTX
Introduction to the Selenium_Session1.pptx
PPTX
Demystifying Selenium framework
PPTX
What is Selenium Introduction to Selenium Testing.pptx
PDF
anoverviewofseleniumwebdriver-160407055026 (pdf.io).pdf
PPTX
Selenium.pptxgsjdxhasdjhckcjjkdcbdcbvdciosdc
PPTX
Basics of selenium containing features of selenium
PDF
Selenium Automation Testing - A Complete Guide
PPT
Selenium
PDF
Reasons behind selenium automation testing popularity
PPTX
Selenium
PDF
Selenium - Introduction
PPTX
Selenium presentation
PPT
Selenium Primer
PDF
Basics of Selenium IDE,Core, Remote Control
Selenium introduction
Introduction to selenium
Selenium introduction
test-automation-selenium-160216124839.pptx
Introduction to the Selenium_Session1.pptx
Demystifying Selenium framework
What is Selenium Introduction to Selenium Testing.pptx
anoverviewofseleniumwebdriver-160407055026 (pdf.io).pdf
Selenium.pptxgsjdxhasdjhckcjjkdcbdcbvdciosdc
Basics of selenium containing features of selenium
Selenium Automation Testing - A Complete Guide
Selenium
Reasons behind selenium automation testing popularity
Selenium
Selenium - Introduction
Selenium presentation
Selenium Primer
Basics of Selenium IDE,Core, Remote Control
Ad

More from Simplilearn (20)

PPTX
Top 50 Scrum Master Interview Questions | Scrum Master Interview Questions & ...
PPTX
Bagging Vs Boosting In Machine Learning | Ensemble Learning In Machine Learni...
PPTX
Future Of Social Media | Social Media Trends and Strategies 2025 | Instagram ...
PPTX
SQL Query Optimization | SQL Query Optimization Techniques | SQL Basics | SQL...
PPTX
SQL INterview Questions .pTop 45 SQL Interview Questions And Answers In 2025 ...
PPTX
How To Start Influencer Marketing Business | Influencer Marketing For Beginne...
PPTX
Cyber Security Roadmap 2025 | How To Become Cyber Security Engineer In 2025 |...
PPTX
How To Become An AI And ML Engineer In 2025 | AI Engineer Roadmap | AI ML Car...
PPTX
What Is GitHub Copilot? | How To Use GitHub Copilot? | How does GitHub Copilo...
PPTX
Top 10 Data Analyst Certification For 2025 | Best Data Analyst Certification ...
PPTX
Complete Data Science Roadmap For 2025 | Data Scientist Roadmap For Beginners...
PPTX
Top 7 High Paying AI Certifications Courses For 2025 | Best AI Certifications...
PPTX
Data Cleaning In Data Mining | Step by Step Data Cleaning Process | Data Clea...
PPTX
Top 10 Data Analyst Projects For 2025 | Data Analyst Projects | Data Analysis...
PPTX
AI Engineer Roadmap 2025 | AI Engineer Roadmap For Beginners | AI Engineer Ca...
PPTX
Machine Learning Roadmap 2025 | Machine Learning Engineer Roadmap For Beginne...
PPTX
Kotter's 8-Step Change Model Explained | Kotter's Change Management Model | S...
PPTX
Gen AI Engineer Roadmap For 2025 | How To Become Gen AI Engineer In 2025 | Si...
PPTX
Top 10 Data Analyst Certification For 2025 | Best Data Analyst Certification ...
PPTX
Complete Data Science Roadmap For 2025 | Data Scientist Roadmap For Beginners...
Top 50 Scrum Master Interview Questions | Scrum Master Interview Questions & ...
Bagging Vs Boosting In Machine Learning | Ensemble Learning In Machine Learni...
Future Of Social Media | Social Media Trends and Strategies 2025 | Instagram ...
SQL Query Optimization | SQL Query Optimization Techniques | SQL Basics | SQL...
SQL INterview Questions .pTop 45 SQL Interview Questions And Answers In 2025 ...
How To Start Influencer Marketing Business | Influencer Marketing For Beginne...
Cyber Security Roadmap 2025 | How To Become Cyber Security Engineer In 2025 |...
How To Become An AI And ML Engineer In 2025 | AI Engineer Roadmap | AI ML Car...
What Is GitHub Copilot? | How To Use GitHub Copilot? | How does GitHub Copilo...
Top 10 Data Analyst Certification For 2025 | Best Data Analyst Certification ...
Complete Data Science Roadmap For 2025 | Data Scientist Roadmap For Beginners...
Top 7 High Paying AI Certifications Courses For 2025 | Best AI Certifications...
Data Cleaning In Data Mining | Step by Step Data Cleaning Process | Data Clea...
Top 10 Data Analyst Projects For 2025 | Data Analyst Projects | Data Analysis...
AI Engineer Roadmap 2025 | AI Engineer Roadmap For Beginners | AI Engineer Ca...
Machine Learning Roadmap 2025 | Machine Learning Engineer Roadmap For Beginne...
Kotter's 8-Step Change Model Explained | Kotter's Change Management Model | S...
Gen AI Engineer Roadmap For 2025 | How To Become Gen AI Engineer In 2025 | Si...
Top 10 Data Analyst Certification For 2025 | Best Data Analyst Certification ...
Complete Data Science Roadmap For 2025 | Data Scientist Roadmap For Beginners...

Recently uploaded (20)

PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Business Ethics Teaching Materials for college
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Pre independence Education in Inndia.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
Pharma ospi slides which help in ospi learning
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PPTX
Cell Structure & Organelles in detailed.
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
01-Introduction-to-Information-Management.pdf
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Basic Mud Logging Guide for educational purpose
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
RMMM.pdf make it easy to upload and study
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Microbial disease of the cardiovascular and lymphatic systems
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Business Ethics Teaching Materials for college
VCE English Exam - Section C Student Revision Booklet
Module 4: Burden of Disease Tutorial Slides S2 2025
Renaissance Architecture: A Journey from Faith to Humanism
Pre independence Education in Inndia.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Pharma ospi slides which help in ospi learning
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
Cell Structure & Organelles in detailed.
2.FourierTransform-ShortQuestionswithAnswers.pdf
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
01-Introduction-to-Information-Management.pdf
TR - Agricultural Crops Production NC III.pdf
Basic Mud Logging Guide for educational purpose
Anesthesia in Laparoscopic Surgery in India
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
RMMM.pdf make it easy to upload and study
Pharmacology of Heart Failure /Pharmacotherapy of CHF

Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Selenium | Simplilearn

  • 2. What is Selenium? What’s in it for you?
  • 3. What is Selenium? Why Selenium WebDriver? What’s in it for you?
  • 4. What is Selenium? Why Selenium WebDriver? What is Selenium WebDriver? What’s in it for you?
  • 5. What is Selenium? Why Selenium WebDriver? What is Selenium WebDriver? Architecture of Selenium WebDriver What’s in it for you?
  • 6. What’s in it for you? What is Selenium? Why Selenium WebDriver? What is Selenium WebDriver? Architecture of Selenium WebDriver Limitations of Selenium WebDriver
  • 7. What’s in it for you? What is Selenium? Why Selenium WebDriver? What is Selenium WebDriver? Architecture of Selenium WebDriver Demo: Automation testing with WebDriver Limitations of Selenium WebDriver
  • 9. Advent of Selenium Why can’t I test for the performance No good scope eitherSo many errors! Time consuming Conventional manual testing has several drawbacks and is extremely monotonous
  • 10. Drawbacks of Manual Testing Time consuming
  • 11. Drawbacks of Manual Testing Error-prone Time consuming
  • 12. Drawbacks of Manual Testing Limited scope for testingError prone Time consuming
  • 13. Drawbacks of Manual Testing Time consuming Why can’t I test for the performance?? Limited scope for testingError prone
  • 14. Advent of Selenium Why can’t I test for the performance No good scope eitherSo many errors! Time consuming Selenium originated in 2004 - as a tool for testing web applications
  • 15. Advent of Selenium Why can’t I test for the performance No good scope eitherSo many errors! Time consuming Selenium originated in 2004 - as a tool for testing web applications It was developed by Jason Huggins, a programmer at ThoughtWorks
  • 16. Advent of Selenium Why can’t I test for the performance No good scope eitherSo many errors! Time consuming Selenium originated in 2004 - as a tool for testing web applications It was developed by Jason Huggins, a programmer at ThoughtWorks It competed against other automation testing tools like QTP (Quick test Professional) developed by HP and RFT(Rational functional tester) developed by IBM
  • 17. Advent of Selenium Why can’t I test for the performance No good scope eitherSo many errors! Time consuming Selenium originated in 2004 - as a tool for testing web applications It was developed by Jason Huggins, a programmer at ThoughtWorks It competed against other automation testing tools like QTP (Quick test Professional) developed by HP and RFT(Rational functional tester) developed by IBM Selenium was developed as JavaScriptTestRunner and evolved over years as a powerful automated testing tool
  • 18. Widely used automation testing tool What is Selenium?
  • 19. Widely used automation testing tool Tests web applications across various browsers What is Selenium?
  • 20. Widely used automation testing tool Tests web applications across various browsers Consists of a set of software tools that facilitate testing What is Selenium?
  • 21. Widely used automation testing tool Tests web applications across various browsers Consists of a set of software tools that facilitate testing Platform independent and open source What is Selenium?
  • 22. Selenium is primarily developed in Java Script What is Selenium?
  • 23. Selenium is primarily developed in Java Script It provides a record/playback tool for authoring tests without learning a test scripting language What is Selenium?
  • 24. Selenium is primarily developed in Java Script It provides a record/playback tool for authoring tests without learning a test scripting language The tests can also be coded in a number of popular programming languages What is Selenium?
  • 25. Selenium is primarily developed in Java Script It provides a record/playback tool for authoring tests without learning a test scripting language Selenium can be deployed on Windows, Linux, and Macintosh What is Selenium? The tests can also be coded in a number of popular programming languages
  • 26. Selenium suite Selenium IDE Selenium test suite Browser plugin that records user actions and exports them as a reusable script Selenium suite
  • 27. Selenium suite Selenium IDE Selenium RC Selenium test suite • Multi-programming and multi browser support • Deprecated in Selenium 2 Browser plugin that records user actions and exports them as a reusable script Selenium suite
  • 28. Selenium suite Selenium IDE Selenium RC Selenium WebDriver Selenium test suite Browser plugin that records user actions and exports them as a reusable script • Uses APIs to interact with the browser • Successor of Selenium RC • Multi-programming and multi browser support • Deprecated in Selenium 2 Selenium suite
  • 29. Selenium suite Selenium IDE Selenium RC Selenium WebDriver Selenium Grid Selenium test suite Browser plugin that records user actions and exports them as a reusable script • Runs multiple tests against different browsers. • Capable of running tests in parallel • Uses APIs to interact with the browser • Successor of Selenium RC • Multi-programming and multi browser support • Deprecated in Selenium 2 Selenium suite
  • 30. Selenium suite Selenium 1 Selenium 2 Selenium 3 Selenium 4 Selenium IDE Selenium RC Grid Selenium IDE *Selenium RC Grid Selenium IDE Selenium WebDriver Grid Selenium WebDriver Version 4 is just around the corner. However, Alpha has been released!
  • 32. Let’s first discuss Selenium RC and its shortcomings
  • 33. Working principle of Selenium RC Selenium Remote Control (RC) is a test tool that allows you to write automated web application UI tests in any programming language against any HTTP website using any mainstream JavaScript-enabled browser.
  • 34. Selenium test script RC server Web browser Web server Test script written in any programming language like JAVA, PHP, Python etc. Working principle of Selenium RC
  • 35. Selenium test script RC server Web browser Web server Selenium Server receives Selenium commands from your test program, interprets them, and reports the results back to the program Working principle of Selenium RC
  • 36. Selenium test script RC server Web browser Web server The Web browser is injected with Selenium core which interprets and executes the Selenese commands used in the test script Working principle of Selenium RC
  • 37. Selenium test script RC server Web browser Web server The Web browser can now interact with the web server accordingly Working principle of Selenium RC
  • 38. Selenium test script RC Server Web browser Web server RC consists of an additional server that acts as a middle man This additional setup complicates the architecture The time taken for execution of commands is longer Shortcomings of Selenium RC
  • 39. How does Selenium WebDriver overcome this?
  • 40. Selenium test script Selenium WebDriver Web browser Web server
  • 41. Selenium test script Selenium WebDriver Web serverWeb browser Selenium-WebDriver does not use an additional server It makes direct calls to the browser using each browser’s native support for automation The execution time for commands is shorter due to the simple architecture
  • 42. A single function has several commands Selenium RC APIs in Selenium RC
  • 43. A single function has several commands Selenium RC APIs in Selenium RC Redundant & confusing APIs
  • 44. A single function has several commands Selenium RC APIs in Selenium RC Redundant & confusing APIs
  • 45. A single function has several commands Selenium RC APIs in Selenium RC Redundant & confusing APIs Different browsers interpret different commands differently
  • 46. A single function has several commands Selenium RC APIs in Selenium RC Redundant & confusing APIs Different browsers interpret different commands differently Selenium WebDriver
  • 47. A single function has several commands Selenium RC APIs in Selenium RC Redundant & confusing APIs Different browsers interpret different commands differently Selenium WebDriver Simple and easy to remember
  • 48. A single function has several commands Selenium RC APIs in Selenium RC Redundant & confusing APIs Different browsers interpret different commands differently Selenium WebDriver No Redundant commands Simple and easy to remember
  • 49. A single function has several commands Selenium RC APIs in Selenium RC Redundant & confusing APIs No Redundant commands Simple and easy to remember Different browsers interpret different commands differently Selenium WebDriver
  • 50. Browser support in Selenium RC Requires a real browser to operate on Does not support HtmlUnit browser No time spent in loading web elements Supports a headless, GUI-less HtmlUnit browser Selenium WebDriverSelenium RC
  • 51. Browser support in Selenium WebDriver Requires a real browser to operate on Does not support HtmlUnit browser No time spent in loading web elements Supports a headless, GUI-less HtmlUnit browser Selenium RC Selenium WebDriver
  • 52. Simple architecture Faster execution Interacts directly with the browser Easy to use APIs Support for HtmlUnit browser Complex architecture Slower execution Requires an RC server to interact with the browser Confusing APIs No support for HtmlUnit browser To summarize… Selenium WebDriverSelenium RC
  • 53. What is Selenium WebDriver?
  • 54. What is Selenium WebDriver? Selenium WebDriver is a tool that runs automated tests across different browsers
  • 55. What is Selenium WebDriver?
  • 56. What is Selenium WebDriver? Founded by Simon Stewart in 2006
  • 57. What is Selenium WebDriver? Founded by Simon Stewart in 2006 It is a cross platform testing framework
  • 58. Founded by Simon Stewart in 2006 It is a cross platform testing framework Programming interface to create and run test cases What is Selenium WebDriver?
  • 59. What is Selenium WebDriver? Founded by Simon Stewart in 2006 It is a cross platform testing framework Programming interface to create and run test cases Makes provision to perform action on web elements
  • 60. What is Selenium WebDriver? Founded by Simon Stewart in 2006 It is a cross platform testing framework Programming interface to create and run test cases Makes provision to perform action on web elements Does not require a core engine like RC and interacts natively with the browser applications
  • 61. What is Selenium WebDriver? Founded by Simon Stewart in 2006 It is a cross platform testing framework Programming interface to create and run test cases Makes provision to perform action on web elements Does not require a core engine like RC and interacts natively with the browser applications Supports Java, C#, PHP, Python, Perl, Ruby etc.
  • 62. What is Selenium WebDriver? Founded by Simon Stewart in 2006 It is a cross platform testing framework Programming interface to create and run test cases Makes provision to perform action on web elements Does not require a core engine like RC and interacts natively with the browser applications Supports Java, C#, PHP, Python, Perl, Ruby etc. Supports frameworks like TestNG, JUnit, NUnit
  • 64. JSON Wire Protocol Browsers • Chrome browser • Firefox browser • Opera browser • Safari browser • Edge browser Http over Http Server Browser Drivers • ChromeDriver • FirefoxDriver • OperaDriver • SafariDriver • EdgeDriver Http over Http Server Architecture of Selenium WebDriver Selenium test script (Java, PHP, Perl…) Selenium test script is the test code written in any of the mentioned programming languages that is interpreted by the driver
  • 65. Browsers • Chrome browser • Firefox browser • Opera browser • Safari browser • Edge browser Browser Drivers • ChromeDriver • FirefoxDriver • OperaDriver • SafariDriver • EdgeDriver Http over Http Server Http over Http Server Architecture of Selenium WebDriver Selenium test script (Java, PHP, Perl…) JSON Wire Protocol JSON Wire Protocol provides a transport mechanism to transfer data between a server and a client. JSON Wire Protocol serves as an industry standard for various web services
  • 66. Browsers • Chrome browser • Firefox browser • Opera browser • Safari browser • Edge browser Http over Http Server Http over Http Server Architecture of Selenium WebDriver Selenium test script (Java, PHP, Perl…) JSON Wire Protocol Browser Drivers • ChromeDriver • FirefoxDriver • OperaDriver • SafariDriver • EdgeDriver Selenium uses drivers, specific to each browser in order to establish a secure connection with the browser
  • 67. Architecture of Selenium WebDriver Selenium test script (Java, PHP, Perl…) JSON Wire Protocol Browser Drivers • ChromeDriver • FirefoxDriver • OperaDriver • SafariDriver • EdgeDriver Browsers • Chrome browser • Firefox browser • Opera browser • Safari browser • Edge browser Http over Http Server Http over Http Server Selenium WebDriver supports various web browsers to test and run applications on
  • 69. Cannot handle pop-ups and advertisement windows Limitations of WebDriver Cannot test mobile applications. Requires frameworks like Appium
  • 70. Cannot handle pop-ups and advertisement windows Limitations of WebDriver Cannot test mobile applications. Requires frameworks like Appium Can only perform sequential testing hence requires Grid for parallel testing
  • 71. Cannot handle pop-ups and advertisement windows Limitations of WebDriver Cannot test mobile applications. Requires frameworks like Appium Can only perform sequential testing hence requires Grid for parallel testing Limited reporting. Third party tools like TestNG are required CrossBrowserTesting
  • 72. Cannot handle pop-ups and advertisement windows Limitations of WebDriver Cannot test mobile applications. Requires frameworks like Appium Can only perform sequential testing hence requires Grid for parallel testing Limited reporting. Third party tools like TestNG are required CrossBrowserTesting Limited image testing
  • 73. Demo: Automation testing using WebDriver
  • 74. Browser APIs and their usage Get Commands driver.get(“https://www.google.co.in”); driver.getTitle(); driver.getCurrentUrl(); driver.getPageSource(); driver.getWindowHandle(); driver.getWindowHandles(); Navigation Commands driver.navigate().to("https://www.ebay.in/"); driver.navigate().back(); driver.navigate().forward(); driver.navigate().refresh(); Locator Commands driver.findElement(By.id(“user”)); driver.findElement(By.linkText(“click here”)); driver.findElement(By.name(“admin”)); driver.findElement(By.className(“main-container”)); driver.findElement(By.cssSelector(“#primary”)); driver.findElement(By.xpath(“//*[@id="primary"]”)); Browser Commands driver.close() Closes the current browser window driver.quit() Quits the entire browser session
  • 75. Demo Use case Usecase 1 : As a user, I want to login to ebay.in and search for “JBL Speakers” Then I want to check the day’s deals Usecase 2 : From ebay.in, navigate to Simplilearn website. And navigate back to ebay.in Usecase 3: From ebay.in, I want to print the page title and close the browser
  • 77. Key Takeaways • What is Selenium • Limitations of Selenium RC and how WebDriver overcomes it • What is Selenium WebDriver? • Architecture of Selenium WebDriver • Limitations of Selenium WebDriver • Browser APIs and their usage

Editor's Notes