SlideShare a Scribd company logo
Selenium Basics and
Overview
Chapter 1
Topics
 Introduction to Browser Automation
 What is Selenium and Overview
 History and evolution of Selenium
 Selenium Components (WebDriver vs Selenium IDE vs Selenium Grid)
 Supported programming languages
 Cross-browser and cross-platform compatibility.
 1. Reason for Cross Browser Testing
 2. Cross-platform testing (such as Windows, iOS, Android, macOS, and Linux)
 Advantages and limitations of Selenium
Introduction to Browser Automation
Perform Testing in any web browsers using Automation
tools such as Selenium, Cypress, Playwright etc. to
reduce the manual effort and deliver with more quality in
minimum hours.
What is Selenium and Overview
Selenium WebDriver is a powerful and widely used open-source tool
for automating web browsers. It provides a programming interface
to interact with web browsers, allowing users to automate browser
actions, navigate web pages, and perform functional testing.
History and evolution of Selenium
• Selenium was established in 2004 at Thoughtworks in Chicago, by Jason
Huggins. It spans over two decades, transforming from a simple tool into
most demanded Automation tool in the market.
• Initially, Selenium started with Selenium RC, which allowed for
automated testing of web applications. It then evolved into Selenium
WebDriver, enhancing its capabilities and adapting to the needs of modern
web applications.
Selenium Components (WebDriver vs Selenium IDE vs Selenium Grid)
Selenium IDE Selinium RC Selinium Web-driver
Only works on Mozilla Firefox Internet Explorer, Mozilla
Firefox, Google Chrome, Safari
and Opera
Works on latest versions of major
browsers- Firefox, IE, Edge,
Chrome
Record and Play tool No Record and Play No Record and Play
JavaScript-based core engine JavaScript-based core engine Interacts natively with browser
application
No programming knowledge
required
Programming knowledge
required
Programming knowledge
required
Supported programming languages
Selenium WebDriver supports multiple programming
languages such as Python, Java, C#, Ruby, JavaScript,
making it versatile for developers working in different
technology stacks
Cross-browser and cross-platform compatibility
Reason for Cross Browser
Testing:
 Font size mismatch in
different browsers.
 Page alignment and div
size
 Browser incompatibility
with OS. Etc
Cross-platform testing (such as Windows, iOS,
Android, macOS, and Linux):
 To ensure that your application functions flawlessly
on different platforms, it must be rigorously tested
across these various environments.
 Cross-platform testing is crucial for identifying and
resolving issues related to usability, consistency,
user interface, and performance across different
devices, browser versions, and operating systems.
Advantages and limitations of Selenium
Advantages:
 Selenium is an open source, freeware and portable tool.
 Selenium supports variety of languages that include Java, Perl, Python, C#, Ruby, Groovy, Java Script and etc.
 Selenium supports many operating systems like Windows, Linux, Unix etc.
 Selenium supports many browsers like Internet explorer, Chrome, Firefox, Edge, Safari etc.
 Selenium can be integrated with Maven kind of framework for source code compilation.
 Selenium can be integrated with TestNG testing framework for testing our applications and generating reports.
 Selenium can be integrated with Jenkins or Azure devops for continuous integration.
 Selenium can be integrated with other open source tools for supporting other features.
 Selenium can be used for Android, IPhone, Blackberry etc. based application testing.
Limitations Of Selenium
• Selenium doesn’t support windows based applications. It supports only web-based applications which
imply only website testing is possible with Selenium.
• Windows-based pops are part of the operating system. It’s beyond Selenium’s capabilities. You can
make use of AutoIT to handle the windows based popups.
• Handling captcha is a limitation in selenium. There are some third-party tools to automate captcha
(2Captcha, Anti-Captcha, and DeathByCaptcha), however, you cannot achieve 100% results.
• It is not possible to perform testing on images. To do so, you need to integrate Selenium with Sikuli
for image-based testing.
• Maintenance is required frequently to maintain the Automation script.
• Coding knowledge is must in order to develop the script.
Selenium Architecture
Chapter 2
Topics
•What is Selenium Webdriver
•WebDriver Architecture
What is Selenium Webdriver
• WebDriver is one of the component in selenium.
• WebDriver is a java interface.
• WebDriver is an API( Application Programming interface)
WebDriver Architecture
 Selenium supports various programming languages such as Java, Python, C#,
Ruby, and more. These libraries provide bindings or APIs that allow you to
interact with Selenium and control the browser using the chosen
programming language. For example, if you are using Java, you would use the
Selenium Java client library, and if you are using Python, you would use the
Selenium Python client library
 JSON Wire Protocol is a RESTful web service that acts as a communication
bridge between the Selenium Client Libraries and the Browser Drivers. It
defines a standard way for sending commands to the browser and receiving
responses.
 Browser Drivers are executable files or libraries specific to each browser.
They act as intermediaries between the Selenium Client Libraries and the
actual browsers. The client libraries communicate with the browser drivers,
and the drivers, in turn, control the respective browsers.
Setting up Selenium Environment
Chapter - 3
Installation
• Installing Java Development Kit (JDK)
Click here for JDK installation
• Installing Eclipse (IDE)
Click here for Eclipse installation
• Selenium WebDriver installation
Click here for Selenium WebDriver installation
Selenium Environment
Chapter - 4
Topics
• How to identify the locators in web page
• Launching Browsers in Selenium
How to identify the locators in web page
Step 1: Right click on the click where you need to interact with
Step 2 : Click Inspect à DOM structure will be getting opened
Step 3: hover on the highlighted tag à Ensure that it is locating expected
element in UI
Launching Browsers in Selenium
EdgeOptions edgeOptions = new EdgeOptions();
edgeOptions.addArguments("--start-maximized");
edgeOptions.addArguments("--remote-allow-origins=*");
WebDriver driver = new EdgeDriver(edgeOptions);
driver.get("https://www.google.com");
driver.close();
Locating Various Web elements
Chapter - 5
Topics
•Types of Locators in Selenium
•Dropdown handling
Types of Locators in Selenium
• ID
• Name
• Class
• Link text
• Partial link text
• CSS Selector
• Xpath
Click here to find locator details.
Dropdown handling
Using Select class –
Syntax
Syntax:
Select objSelect = new Select(driver.findElement(By.id("search-box")));
objSelect.selectByVisibleText("Economy");
objSelect.selectByValue("Value");
objSelect.selectByIndex(1);
How to get all the options in dropdown :
List<WebElement> options = objSelect.getOptions();
Example
Example:
driver.findElement(By.xpath("//a[@id='flights']")).click();
Select objSelect = new
Select(driver.findElement(By.xpath("//select[@name='sr_cabin_class']")));
objSelect.selectByVisibleText("Business");
List<WebElement> options = objSelect.getOptions();
for(WebElement dropdown: options) {
System.out.println(dropdown.getText());
}
Without using Select class –
driver.findElement(By.xpath("//a[@id='flights']")).click();
driver.findElement(By.xpath("//select[@name='sr_cabin_class']")).click();
List<WebElement> options = driver.findElements(By.xpath("//select[@name='sr_cabin_class']/option"));
for(int i=0; i<=options.size(); i++) {
String value = options.get(i).getText();
if(value.equals("Business")) {
options.get(i).click();
break;
}
Find Radio Element
Select as text:
//
div[contains(@class,'Text
-module__root--variant')
and text ()='One-way']
Select as button:
//
div[contains(@class,'Text
-module__root--variant')
and text
()='One-way']/preceding::
span[contains(@class,'Inp
utRadio-module')][1]
Chapter 6
Desired Capabilities in Selenium Webdriver
HashMap<String, Object> edgePrefs = new HashMap<String, Object>();
edgePrefs.put("profile.default_content_settings.popups", 0);
EdgeOptions edgeOptions = new EdgeOptions();
edgeOptions.addArguments("--start-maximized");
edgeOptions.addArguments("--remote-allow-origins=*");
WebDriver driver = new EdgeDriver(edgeOptions);
Selenium webDriver commands and Web
elements interactions
Chapter - 7
Topics
• Selenium WebDriver- Commands
• Text fields and buttons
• Find Element VS FindElements in Selenium WebDriver - check order
• Selenium WebDriver- Commands:
• Text fields and buttons
driver.get("https://www.booking.com");
driver.manage().timeouts().implicitlyWait(10,
TimeUnit.SECONDS);
driver.findElement(By.xpath("//
input[@name='ss']")).sendKeys("Chennai");
driver.findElement(By.xpath("//li[contains(@id,'autocomplete-
result')]//div[text()='Chennai']")).click();
Find Element VS FindElements in
Selenium WebDriver- check order
Aspect FindElement FindElements
Purpose FindElement Locate a single web element FindElements Locate multiple web elements
Return
Type
FindElement returns a WebElement FindElements return List<WebElement>
Behavior if
Not
Found
FindElement throws
NoSuchElementException
FindElements returns an empty list
First Matching It returns the first matching element It returns all matching elements
Element
Syntax WebElement element =
driver.findElement(By.id("elementId"));
List<WebElement> elements =
driver.findElements(By.className("elementClass"));
Example
driver.findElement(By.xpath("//input[@name='ss']")).click();
List<WebElement> options = driver.findElements(By.xpath("//div[text()='Popular
destinations nearby']/following-sibling::ul/li//span/following-sibling::div/div[1]"));
for(int i=0; i<=options.size(); i++) {
String value = options.get(i).getText();
if(value.startsWith("V")) {
options.get(i).click();
break;
}
}
Ad

More Related Content

Similar to Selenium Basics and Overview topics.pptx (20)

Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using selenium
Cynoteck Technology Solutions Private Limited
 
selenium-webdriver-interview-questions.pdf
selenium-webdriver-interview-questions.pdfselenium-webdriver-interview-questions.pdf
selenium-webdriver-interview-questions.pdf
AnuragMourya8
 
A Simple Guide to Selenium Software Testing
A Simple Guide to Selenium Software TestingA Simple Guide to Selenium Software Testing
A Simple Guide to Selenium Software Testing
Calidad Infotech
 
Selenium-Automation-The-Definitive-Guide (1).pptx
Selenium-Automation-The-Definitive-Guide (1).pptxSelenium-Automation-The-Definitive-Guide (1).pptx
Selenium-Automation-The-Definitive-Guide (1).pptx
shivanshpandeyrewa20
 
Selenium&amp;scrapy
Selenium&amp;scrapySelenium&amp;scrapy
Selenium&amp;scrapy
Arcangelo Saracino
 
Selenium Web Driver Tutorial for Cross Browser Testing
Selenium Web Driver Tutorial for Cross Browser TestingSelenium Web Driver Tutorial for Cross Browser Testing
Selenium Web Driver Tutorial for Cross Browser Testing
Sarah Elson
 
Selenium PPT 2.pptx
Selenium PPT 2.pptxSelenium PPT 2.pptx
Selenium PPT 2.pptx
ssusere4c6aa
 
Selenium Webdriver Interview Questions
Selenium Webdriver Interview QuestionsSelenium Webdriver Interview Questions
Selenium Webdriver Interview Questions
Jai Singh
 
Top 21 Selenium FAQs.pdf
Top 21 Selenium FAQs.pdfTop 21 Selenium FAQs.pdf
Top 21 Selenium FAQs.pdf
AnanthReddy38
 
25 Top Selenium Interview Questions and Answers for 2023.pdf
25 Top Selenium Interview Questions and Answers for 2023.pdf25 Top Selenium Interview Questions and Answers for 2023.pdf
25 Top Selenium Interview Questions and Answers for 2023.pdf
AnanthReddy38
 
Selenide
SelenideSelenide
Selenide
DataArt
 
A Definitive Guide to Mastering Selenium WebDriver Automation Effectively.pptx
A Definitive Guide to Mastering Selenium WebDriver Automation Effectively.pptxA Definitive Guide to Mastering Selenium WebDriver Automation Effectively.pptx
A Definitive Guide to Mastering Selenium WebDriver Automation Effectively.pptx
Matthew Allen
 
Selenium online training nareshit
Selenium online training nareshitSelenium online training nareshit
Selenium online training nareshit
AvinashNareshIT
 
#2 integration + ui tests
#2 integration + ui tests#2 integration + ui tests
#2 integration + ui tests
eleksdev
 
Selenium
SeleniumSelenium
Selenium
Kalyan ch
 
Selenium Interview Questions And Answers | Selenium Interview Questions | Sel...
Selenium Interview Questions And Answers | Selenium Interview Questions | Sel...Selenium Interview Questions And Answers | Selenium Interview Questions | Sel...
Selenium Interview Questions And Answers | Selenium Interview Questions | Sel...
Simplilearn
 
Best Selenium course Online Training in Hyderabad Naresh-IT
Best Selenium course Online Training in Hyderabad Naresh-ITBest Selenium course Online Training in Hyderabad Naresh-IT
Best Selenium course Online Training in Hyderabad Naresh-IT
manoharnaidunareshit
 
Selenium Testing: A Comprehensive Guide to Automated Web Testing
Selenium Testing: A Comprehensive Guide to Automated Web TestingSelenium Testing: A Comprehensive Guide to Automated Web Testing
Selenium Testing: A Comprehensive Guide to Automated Web Testing
pCloudy
 
Selenium Introduction and IDE
Selenium Introduction and IDESelenium Introduction and IDE
Selenium Introduction and IDE
Murageppa-QA
 
Interview Question & Answers for Selenium Freshers | LearningSlot
Interview Question & Answers for Selenium Freshers | LearningSlotInterview Question & Answers for Selenium Freshers | LearningSlot
Interview Question & Answers for Selenium Freshers | LearningSlot
Learning Slot
 
selenium-webdriver-interview-questions.pdf
selenium-webdriver-interview-questions.pdfselenium-webdriver-interview-questions.pdf
selenium-webdriver-interview-questions.pdf
AnuragMourya8
 
A Simple Guide to Selenium Software Testing
A Simple Guide to Selenium Software TestingA Simple Guide to Selenium Software Testing
A Simple Guide to Selenium Software Testing
Calidad Infotech
 
Selenium-Automation-The-Definitive-Guide (1).pptx
Selenium-Automation-The-Definitive-Guide (1).pptxSelenium-Automation-The-Definitive-Guide (1).pptx
Selenium-Automation-The-Definitive-Guide (1).pptx
shivanshpandeyrewa20
 
Selenium Web Driver Tutorial for Cross Browser Testing
Selenium Web Driver Tutorial for Cross Browser TestingSelenium Web Driver Tutorial for Cross Browser Testing
Selenium Web Driver Tutorial for Cross Browser Testing
Sarah Elson
 
Selenium PPT 2.pptx
Selenium PPT 2.pptxSelenium PPT 2.pptx
Selenium PPT 2.pptx
ssusere4c6aa
 
Selenium Webdriver Interview Questions
Selenium Webdriver Interview QuestionsSelenium Webdriver Interview Questions
Selenium Webdriver Interview Questions
Jai Singh
 
Top 21 Selenium FAQs.pdf
Top 21 Selenium FAQs.pdfTop 21 Selenium FAQs.pdf
Top 21 Selenium FAQs.pdf
AnanthReddy38
 
25 Top Selenium Interview Questions and Answers for 2023.pdf
25 Top Selenium Interview Questions and Answers for 2023.pdf25 Top Selenium Interview Questions and Answers for 2023.pdf
25 Top Selenium Interview Questions and Answers for 2023.pdf
AnanthReddy38
 
Selenide
SelenideSelenide
Selenide
DataArt
 
A Definitive Guide to Mastering Selenium WebDriver Automation Effectively.pptx
A Definitive Guide to Mastering Selenium WebDriver Automation Effectively.pptxA Definitive Guide to Mastering Selenium WebDriver Automation Effectively.pptx
A Definitive Guide to Mastering Selenium WebDriver Automation Effectively.pptx
Matthew Allen
 
Selenium online training nareshit
Selenium online training nareshitSelenium online training nareshit
Selenium online training nareshit
AvinashNareshIT
 
#2 integration + ui tests
#2 integration + ui tests#2 integration + ui tests
#2 integration + ui tests
eleksdev
 
Selenium Interview Questions And Answers | Selenium Interview Questions | Sel...
Selenium Interview Questions And Answers | Selenium Interview Questions | Sel...Selenium Interview Questions And Answers | Selenium Interview Questions | Sel...
Selenium Interview Questions And Answers | Selenium Interview Questions | Sel...
Simplilearn
 
Best Selenium course Online Training in Hyderabad Naresh-IT
Best Selenium course Online Training in Hyderabad Naresh-ITBest Selenium course Online Training in Hyderabad Naresh-IT
Best Selenium course Online Training in Hyderabad Naresh-IT
manoharnaidunareshit
 
Selenium Testing: A Comprehensive Guide to Automated Web Testing
Selenium Testing: A Comprehensive Guide to Automated Web TestingSelenium Testing: A Comprehensive Guide to Automated Web Testing
Selenium Testing: A Comprehensive Guide to Automated Web Testing
pCloudy
 
Selenium Introduction and IDE
Selenium Introduction and IDESelenium Introduction and IDE
Selenium Introduction and IDE
Murageppa-QA
 
Interview Question & Answers for Selenium Freshers | LearningSlot
Interview Question & Answers for Selenium Freshers | LearningSlotInterview Question & Answers for Selenium Freshers | LearningSlot
Interview Question & Answers for Selenium Freshers | LearningSlot
Learning Slot
 

Recently uploaded (20)

Pixida, Simplifying Success in Germany, the USA, Brazil, China and Portugal
Pixida, Simplifying Success in Germany, the USA, Brazil, China and PortugalPixida, Simplifying Success in Germany, the USA, Brazil, China and Portugal
Pixida, Simplifying Success in Germany, the USA, Brazil, China and Portugal
TechMeetups
 
Software Development Business Plan1.pptx
Software Development Business Plan1.pptxSoftware Development Business Plan1.pptx
Software Development Business Plan1.pptx
vkprintingsolution
 
What's the Volume Quiz Presentation in Green Grey Purple Simple Lined Style (...
What's the Volume Quiz Presentation in Green Grey Purple Simple Lined Style (...What's the Volume Quiz Presentation in Green Grey Purple Simple Lined Style (...
What's the Volume Quiz Presentation in Green Grey Purple Simple Lined Style (...
shenleighmaemolina
 
RCM-billing in medical coding0000 1.pptx
RCM-billing in medical coding0000 1.pptxRCM-billing in medical coding0000 1.pptx
RCM-billing in medical coding0000 1.pptx
liajohn0808
 
Bronchitis_Presentation_with_Images.pptx
Bronchitis_Presentation_with_Images.pptxBronchitis_Presentation_with_Images.pptx
Bronchitis_Presentation_with_Images.pptx
monmohanchowdhury8
 
Career Planning After Class XII: Your Roadmap to Success
Career Planning After Class XII: Your Roadmap to SuccessCareer Planning After Class XII: Your Roadmap to Success
Career Planning After Class XII: Your Roadmap to Success
Dr. Radhika Sharma
 
Best Fashion Designing Colleges in Delhi
Best Fashion Designing Colleges in DelhiBest Fashion Designing Colleges in Delhi
Best Fashion Designing Colleges in Delhi
top10privatecolleges
 
English For Carrier, It enhance your Communication Skills
English For Carrier, It enhance your Communication SkillsEnglish For Carrier, It enhance your Communication Skills
English For Carrier, It enhance your Communication Skills
ankitbeherabiru
 
History of Entomology and current updates of entomology.pptx
History of Entomology and current updates of entomology.pptxHistory of Entomology and current updates of entomology.pptx
History of Entomology and current updates of entomology.pptx
Neelesh Raipuria
 
remakingyourselfpresentation-250430095415-6476ade1.pptx
remakingyourselfpresentation-250430095415-6476ade1.pptxremakingyourselfpresentation-250430095415-6476ade1.pptx
remakingyourselfpresentation-250430095415-6476ade1.pptx
lakhmanpindariya9176
 
SAFETY BRIEFING.........................
SAFETY BRIEFING.........................SAFETY BRIEFING.........................
SAFETY BRIEFING.........................
BalaChandran458212
 
COMPRESSION MODELSCOMPRESSION MODELSCOMPRESSION MODELS
COMPRESSION MODELSCOMPRESSION MODELSCOMPRESSION MODELSCOMPRESSION MODELSCOMPRESSION MODELSCOMPRESSION MODELS
COMPRESSION MODELSCOMPRESSION MODELSCOMPRESSION MODELS
johncena77770789
 
material-17438335 to the third floor in 47-gsms.pptx
material-17438335 to the third floor in 47-gsms.pptxmaterial-17438335 to the third floor in 47-gsms.pptx
material-17438335 to the third floor in 47-gsms.pptx
JyotirmayNirankari
 
NATIONALISM IN EUROPE class 10 best ppt.pdf
NATIONALISM IN EUROPE class 10 best ppt.pdfNATIONALISM IN EUROPE class 10 best ppt.pdf
NATIONALISM IN EUROPE class 10 best ppt.pdf
leenamakkar79
 
LCL216_2024-2_WEEKS 4 & 5_IF CLAUSES (1).pdf
LCL216_2024-2_WEEKS 4 & 5_IF CLAUSES (1).pdfLCL216_2024-2_WEEKS 4 & 5_IF CLAUSES (1).pdf
LCL216_2024-2_WEEKS 4 & 5_IF CLAUSES (1).pdf
rafaelsago2015
 
UPSC+BAProgramme Syllabus for students who want to pursue UPSC coaching from ...
UPSC+BAProgramme Syllabus for students who want to pursue UPSC coaching from ...UPSC+BAProgramme Syllabus for students who want to pursue UPSC coaching from ...
UPSC+BAProgramme Syllabus for students who want to pursue UPSC coaching from ...
Tushar kumar
 
Huckel_Molecular orbital _Theory_8_Slides.pptx
Huckel_Molecular orbital _Theory_8_Slides.pptxHuckel_Molecular orbital _Theory_8_Slides.pptx
Huckel_Molecular orbital _Theory_8_Slides.pptx
study2022bsc
 
RightShip-Inspection-Maritime-Safety-Simplified.pptx
RightShip-Inspection-Maritime-Safety-Simplified.pptxRightShip-Inspection-Maritime-Safety-Simplified.pptx
RightShip-Inspection-Maritime-Safety-Simplified.pptx
ultronmeg
 
Top Business Schools in Delhi For Quality Education
Top Business Schools in Delhi For Quality EducationTop Business Schools in Delhi For Quality Education
Top Business Schools in Delhi For Quality Education
top10privatecolleges
 
Traditional Medicine aDRTYSRTYSRTnd HIV.ppt
Traditional Medicine aDRTYSRTYSRTnd HIV.pptTraditional Medicine aDRTYSRTYSRTnd HIV.ppt
Traditional Medicine aDRTYSRTYSRTnd HIV.ppt
XolaniRadebe7
 
Pixida, Simplifying Success in Germany, the USA, Brazil, China and Portugal
Pixida, Simplifying Success in Germany, the USA, Brazil, China and PortugalPixida, Simplifying Success in Germany, the USA, Brazil, China and Portugal
Pixida, Simplifying Success in Germany, the USA, Brazil, China and Portugal
TechMeetups
 
Software Development Business Plan1.pptx
Software Development Business Plan1.pptxSoftware Development Business Plan1.pptx
Software Development Business Plan1.pptx
vkprintingsolution
 
What's the Volume Quiz Presentation in Green Grey Purple Simple Lined Style (...
What's the Volume Quiz Presentation in Green Grey Purple Simple Lined Style (...What's the Volume Quiz Presentation in Green Grey Purple Simple Lined Style (...
What's the Volume Quiz Presentation in Green Grey Purple Simple Lined Style (...
shenleighmaemolina
 
RCM-billing in medical coding0000 1.pptx
RCM-billing in medical coding0000 1.pptxRCM-billing in medical coding0000 1.pptx
RCM-billing in medical coding0000 1.pptx
liajohn0808
 
Bronchitis_Presentation_with_Images.pptx
Bronchitis_Presentation_with_Images.pptxBronchitis_Presentation_with_Images.pptx
Bronchitis_Presentation_with_Images.pptx
monmohanchowdhury8
 
Career Planning After Class XII: Your Roadmap to Success
Career Planning After Class XII: Your Roadmap to SuccessCareer Planning After Class XII: Your Roadmap to Success
Career Planning After Class XII: Your Roadmap to Success
Dr. Radhika Sharma
 
Best Fashion Designing Colleges in Delhi
Best Fashion Designing Colleges in DelhiBest Fashion Designing Colleges in Delhi
Best Fashion Designing Colleges in Delhi
top10privatecolleges
 
English For Carrier, It enhance your Communication Skills
English For Carrier, It enhance your Communication SkillsEnglish For Carrier, It enhance your Communication Skills
English For Carrier, It enhance your Communication Skills
ankitbeherabiru
 
History of Entomology and current updates of entomology.pptx
History of Entomology and current updates of entomology.pptxHistory of Entomology and current updates of entomology.pptx
History of Entomology and current updates of entomology.pptx
Neelesh Raipuria
 
remakingyourselfpresentation-250430095415-6476ade1.pptx
remakingyourselfpresentation-250430095415-6476ade1.pptxremakingyourselfpresentation-250430095415-6476ade1.pptx
remakingyourselfpresentation-250430095415-6476ade1.pptx
lakhmanpindariya9176
 
SAFETY BRIEFING.........................
SAFETY BRIEFING.........................SAFETY BRIEFING.........................
SAFETY BRIEFING.........................
BalaChandran458212
 
COMPRESSION MODELSCOMPRESSION MODELSCOMPRESSION MODELS
COMPRESSION MODELSCOMPRESSION MODELSCOMPRESSION MODELSCOMPRESSION MODELSCOMPRESSION MODELSCOMPRESSION MODELS
COMPRESSION MODELSCOMPRESSION MODELSCOMPRESSION MODELS
johncena77770789
 
material-17438335 to the third floor in 47-gsms.pptx
material-17438335 to the third floor in 47-gsms.pptxmaterial-17438335 to the third floor in 47-gsms.pptx
material-17438335 to the third floor in 47-gsms.pptx
JyotirmayNirankari
 
NATIONALISM IN EUROPE class 10 best ppt.pdf
NATIONALISM IN EUROPE class 10 best ppt.pdfNATIONALISM IN EUROPE class 10 best ppt.pdf
NATIONALISM IN EUROPE class 10 best ppt.pdf
leenamakkar79
 
LCL216_2024-2_WEEKS 4 & 5_IF CLAUSES (1).pdf
LCL216_2024-2_WEEKS 4 & 5_IF CLAUSES (1).pdfLCL216_2024-2_WEEKS 4 & 5_IF CLAUSES (1).pdf
LCL216_2024-2_WEEKS 4 & 5_IF CLAUSES (1).pdf
rafaelsago2015
 
UPSC+BAProgramme Syllabus for students who want to pursue UPSC coaching from ...
UPSC+BAProgramme Syllabus for students who want to pursue UPSC coaching from ...UPSC+BAProgramme Syllabus for students who want to pursue UPSC coaching from ...
UPSC+BAProgramme Syllabus for students who want to pursue UPSC coaching from ...
Tushar kumar
 
Huckel_Molecular orbital _Theory_8_Slides.pptx
Huckel_Molecular orbital _Theory_8_Slides.pptxHuckel_Molecular orbital _Theory_8_Slides.pptx
Huckel_Molecular orbital _Theory_8_Slides.pptx
study2022bsc
 
RightShip-Inspection-Maritime-Safety-Simplified.pptx
RightShip-Inspection-Maritime-Safety-Simplified.pptxRightShip-Inspection-Maritime-Safety-Simplified.pptx
RightShip-Inspection-Maritime-Safety-Simplified.pptx
ultronmeg
 
Top Business Schools in Delhi For Quality Education
Top Business Schools in Delhi For Quality EducationTop Business Schools in Delhi For Quality Education
Top Business Schools in Delhi For Quality Education
top10privatecolleges
 
Traditional Medicine aDRTYSRTYSRTnd HIV.ppt
Traditional Medicine aDRTYSRTYSRTnd HIV.pptTraditional Medicine aDRTYSRTYSRTnd HIV.ppt
Traditional Medicine aDRTYSRTYSRTnd HIV.ppt
XolaniRadebe7
 
Ad

Selenium Basics and Overview topics.pptx

  • 2. Topics  Introduction to Browser Automation  What is Selenium and Overview  History and evolution of Selenium  Selenium Components (WebDriver vs Selenium IDE vs Selenium Grid)  Supported programming languages  Cross-browser and cross-platform compatibility.  1. Reason for Cross Browser Testing  2. Cross-platform testing (such as Windows, iOS, Android, macOS, and Linux)  Advantages and limitations of Selenium
  • 3. Introduction to Browser Automation Perform Testing in any web browsers using Automation tools such as Selenium, Cypress, Playwright etc. to reduce the manual effort and deliver with more quality in minimum hours.
  • 4. What is Selenium and Overview Selenium WebDriver is a powerful and widely used open-source tool for automating web browsers. It provides a programming interface to interact with web browsers, allowing users to automate browser actions, navigate web pages, and perform functional testing.
  • 5. History and evolution of Selenium • Selenium was established in 2004 at Thoughtworks in Chicago, by Jason Huggins. It spans over two decades, transforming from a simple tool into most demanded Automation tool in the market. • Initially, Selenium started with Selenium RC, which allowed for automated testing of web applications. It then evolved into Selenium WebDriver, enhancing its capabilities and adapting to the needs of modern web applications.
  • 6. Selenium Components (WebDriver vs Selenium IDE vs Selenium Grid) Selenium IDE Selinium RC Selinium Web-driver Only works on Mozilla Firefox Internet Explorer, Mozilla Firefox, Google Chrome, Safari and Opera Works on latest versions of major browsers- Firefox, IE, Edge, Chrome Record and Play tool No Record and Play No Record and Play JavaScript-based core engine JavaScript-based core engine Interacts natively with browser application No programming knowledge required Programming knowledge required Programming knowledge required
  • 7. Supported programming languages Selenium WebDriver supports multiple programming languages such as Python, Java, C#, Ruby, JavaScript, making it versatile for developers working in different technology stacks
  • 8. Cross-browser and cross-platform compatibility Reason for Cross Browser Testing:  Font size mismatch in different browsers.  Page alignment and div size  Browser incompatibility with OS. Etc Cross-platform testing (such as Windows, iOS, Android, macOS, and Linux):  To ensure that your application functions flawlessly on different platforms, it must be rigorously tested across these various environments.  Cross-platform testing is crucial for identifying and resolving issues related to usability, consistency, user interface, and performance across different devices, browser versions, and operating systems.
  • 9. Advantages and limitations of Selenium Advantages:  Selenium is an open source, freeware and portable tool.  Selenium supports variety of languages that include Java, Perl, Python, C#, Ruby, Groovy, Java Script and etc.  Selenium supports many operating systems like Windows, Linux, Unix etc.  Selenium supports many browsers like Internet explorer, Chrome, Firefox, Edge, Safari etc.  Selenium can be integrated with Maven kind of framework for source code compilation.  Selenium can be integrated with TestNG testing framework for testing our applications and generating reports.  Selenium can be integrated with Jenkins or Azure devops for continuous integration.  Selenium can be integrated with other open source tools for supporting other features.  Selenium can be used for Android, IPhone, Blackberry etc. based application testing.
  • 10. Limitations Of Selenium • Selenium doesn’t support windows based applications. It supports only web-based applications which imply only website testing is possible with Selenium. • Windows-based pops are part of the operating system. It’s beyond Selenium’s capabilities. You can make use of AutoIT to handle the windows based popups. • Handling captcha is a limitation in selenium. There are some third-party tools to automate captcha (2Captcha, Anti-Captcha, and DeathByCaptcha), however, you cannot achieve 100% results. • It is not possible to perform testing on images. To do so, you need to integrate Selenium with Sikuli for image-based testing. • Maintenance is required frequently to maintain the Automation script. • Coding knowledge is must in order to develop the script.
  • 12. Topics •What is Selenium Webdriver •WebDriver Architecture
  • 13. What is Selenium Webdriver • WebDriver is one of the component in selenium. • WebDriver is a java interface. • WebDriver is an API( Application Programming interface)
  • 14. WebDriver Architecture  Selenium supports various programming languages such as Java, Python, C#, Ruby, and more. These libraries provide bindings or APIs that allow you to interact with Selenium and control the browser using the chosen programming language. For example, if you are using Java, you would use the Selenium Java client library, and if you are using Python, you would use the Selenium Python client library  JSON Wire Protocol is a RESTful web service that acts as a communication bridge between the Selenium Client Libraries and the Browser Drivers. It defines a standard way for sending commands to the browser and receiving responses.  Browser Drivers are executable files or libraries specific to each browser. They act as intermediaries between the Selenium Client Libraries and the actual browsers. The client libraries communicate with the browser drivers, and the drivers, in turn, control the respective browsers.
  • 15. Setting up Selenium Environment Chapter - 3
  • 16. Installation • Installing Java Development Kit (JDK) Click here for JDK installation • Installing Eclipse (IDE) Click here for Eclipse installation • Selenium WebDriver installation Click here for Selenium WebDriver installation
  • 18. Topics • How to identify the locators in web page • Launching Browsers in Selenium
  • 19. How to identify the locators in web page Step 1: Right click on the click where you need to interact with
  • 20. Step 2 : Click Inspect à DOM structure will be getting opened
  • 21. Step 3: hover on the highlighted tag à Ensure that it is locating expected element in UI
  • 22. Launching Browsers in Selenium EdgeOptions edgeOptions = new EdgeOptions(); edgeOptions.addArguments("--start-maximized"); edgeOptions.addArguments("--remote-allow-origins=*"); WebDriver driver = new EdgeDriver(edgeOptions); driver.get("https://www.google.com"); driver.close();
  • 23. Locating Various Web elements Chapter - 5
  • 24. Topics •Types of Locators in Selenium •Dropdown handling
  • 25. Types of Locators in Selenium • ID • Name • Class • Link text • Partial link text • CSS Selector • Xpath Click here to find locator details.
  • 27. Syntax Syntax: Select objSelect = new Select(driver.findElement(By.id("search-box"))); objSelect.selectByVisibleText("Economy"); objSelect.selectByValue("Value"); objSelect.selectByIndex(1); How to get all the options in dropdown : List<WebElement> options = objSelect.getOptions();
  • 28. Example Example: driver.findElement(By.xpath("//a[@id='flights']")).click(); Select objSelect = new Select(driver.findElement(By.xpath("//select[@name='sr_cabin_class']"))); objSelect.selectByVisibleText("Business"); List<WebElement> options = objSelect.getOptions(); for(WebElement dropdown: options) { System.out.println(dropdown.getText()); }
  • 29. Without using Select class – driver.findElement(By.xpath("//a[@id='flights']")).click(); driver.findElement(By.xpath("//select[@name='sr_cabin_class']")).click(); List<WebElement> options = driver.findElements(By.xpath("//select[@name='sr_cabin_class']/option")); for(int i=0; i<=options.size(); i++) { String value = options.get(i).getText(); if(value.equals("Business")) { options.get(i).click(); break; }
  • 30. Find Radio Element Select as text: // div[contains(@class,'Text -module__root--variant') and text ()='One-way'] Select as button: // div[contains(@class,'Text -module__root--variant') and text ()='One-way']/preceding:: span[contains(@class,'Inp utRadio-module')][1]
  • 31. Chapter 6 Desired Capabilities in Selenium Webdriver HashMap<String, Object> edgePrefs = new HashMap<String, Object>(); edgePrefs.put("profile.default_content_settings.popups", 0); EdgeOptions edgeOptions = new EdgeOptions(); edgeOptions.addArguments("--start-maximized"); edgeOptions.addArguments("--remote-allow-origins=*"); WebDriver driver = new EdgeDriver(edgeOptions);
  • 32. Selenium webDriver commands and Web elements interactions Chapter - 7
  • 33. Topics • Selenium WebDriver- Commands • Text fields and buttons • Find Element VS FindElements in Selenium WebDriver - check order
  • 35. • Text fields and buttons driver.get("https://www.booking.com"); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); driver.findElement(By.xpath("// input[@name='ss']")).sendKeys("Chennai"); driver.findElement(By.xpath("//li[contains(@id,'autocomplete- result')]//div[text()='Chennai']")).click();
  • 36. Find Element VS FindElements in Selenium WebDriver- check order Aspect FindElement FindElements Purpose FindElement Locate a single web element FindElements Locate multiple web elements Return Type FindElement returns a WebElement FindElements return List<WebElement> Behavior if Not Found FindElement throws NoSuchElementException FindElements returns an empty list First Matching It returns the first matching element It returns all matching elements Element Syntax WebElement element = driver.findElement(By.id("elementId")); List<WebElement> elements = driver.findElements(By.className("elementClass"));
  • 38. driver.findElement(By.xpath("//input[@name='ss']")).click(); List<WebElement> options = driver.findElements(By.xpath("//div[text()='Popular destinations nearby']/following-sibling::ul/li//span/following-sibling::div/div[1]")); for(int i=0; i<=options.size(); i++) { String value = options.get(i).getText(); if(value.startsWith("V")) { options.get(i).click(); break; } }