SlideShare a Scribd company logo
Selenium Webdriver – Installation
and Web elements
Using Python
Here the steps
• The installation and setup of Selenium webdriver in Python
can be done with the steps listed below −
• Step 1 Navigate to the site having the below link
− −
• https://www.python.org/downloads/
• Step 2 Click on the Download Python <version number>
−
button.
Lesson2-Selenium installation 2-6-25.pptx
Step 3 The executable file for Python should get
−
downloaded in our system. On clicking it, the Python
installation page should get launched.
• Step 4 Python should be downloaded in the following
−
path:
• C:Users<User>AppDataLocalProgramsPython
Python<version>
• Step 5 For the Windows users, we have to configure the
−
path of the Python and the Scripts folder (created inside the
Python folder) in the Environment variables.
Step 6 To check if Python has successfully installed, execute the
−
command − py --version. The Python version should get displayed.
Step 7 For the Selenium bindings installation, run the command
−
mentioned below − py –m pip install selenium.
Step 8 A new folder called the Selenium should now be generated
−
within the Python folder (look inside the Lib folder). To upgrade to the
latest Selenium version, run the command given below −
Py –m pip install selenium.
Step 9 To verify if Selenium has been installed properly, execute the
−
command mentioned below −
Py –m pip show Selenium.
Step 10 Next, we have to download the Python editor called PyCharm
−
from the below link −
https://www.jetbrains.com/pycharm/
Step 11 Click on Download.
−
Step 12 For Selenium webdriver in Python, click on the Download button which is below
−
the Community version (free for use).
Lesson2-Selenium installation 2-6-25.pptx
Step 13 After installation of PyCharm, we have to create a new
−
project from File -> New Project -> Give a project name, say
pythonProjectTest. Then, click on Create.
Step 14 We have to create a Python package by right-clicking on the
−
new project we created in Step13, click on New then select Python
Package. Give a package name, say SeleniumTest and proceed.
Step 15 We have to create a Python file by right-clicking on the new package we created in Step 14,
−
click on New then select Python File. Give a package name, say test1.py and proceed.
Step 16 To view the Selenium packages in our
−
project, click on External Libraries and then expand
the site-packages folder.
How to Install PIP on Windows ?
Python is a widely-used general-purpose, high-level programming
language. Python is a programming language that lets you work quickly
and integrate systems more efficiently.
PIP is a package management system used to install and manage
software packages/libraries written in Python. These files are stored in a
large “online repository” termed as Python Package Index (PyPI). pip
uses PyPI as the default source for packages and their dependencies.
So, whenever you type:
pip install package_name
pip will look for that package on PyPI and if found, it will download and
install the package on your local system.
Check if Python is installed
Run the following command to test if python is installed or not. If not
click here.
python --version
Download and Install pip
The PIP can be downloaded and installed using the command line by going through
the following steps:
Method 1: Using cURL in Python
Curl is a UNIX command that is used to send the PUT, GET, and POST requests to a
URL. This tool is utilized for downloading files, testing REST APIs, etc.
Step 1: Open the cmd terminal
Step 2: In python, a curl is a tool for transferring data requests to and from a server.
Use the following command to request:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.pypython get-pip.py
Let’s talk about Selenium
Selenium is an open-source automated
testing suite used by developers for creating
web applications across multiple browsers
and platforms.
Selenium focuses on automating web-based
applications.
Developers are like to perform testing with
There are four key components of it:
 Selenium IDE
 WebDriver
 Selenium Remote Control
 Selenium Grid
Web Element in Selenium
Anything available on the webpage is a
Web Element, such as a button, scroller,
text box, etc.
Selenium WebDriver represents a DOM
element, and we create all the documents
Web
Element for
an HTML
element
There are several techniques with which
the WebDriver can detect the Web
Element, which are dependent on unique
properties, like ID, Name, XPath, Class,
CSS Selectors, Tagname, link Test, etc.
Two main methods offered by WebDriver to find the webpage elements a
FineElement() FindElements()
Types of Web Elements:
Edit Box - This is a basic text control that allows us to enter a small
amount of text.
Button – It is a clickable button that we can use in
different forms and places in the document that
requires a standard, easy-to-use button functionality.
Link – A link is known as a hyperlink that connects
one web page to another. Users can click on that link
to navigate from page to page.
Types of Web Elements:
Image, image button, and image link - It helps to perform
various actions on images like clicking on the image button or
image link.
Text Area - We use this
element to enter a plain text
editing control that includes
multiple lines.
Checkbox - The checkbox is a selection box or
a tick box element made of a small interactive
box that we can mark to indicate 'yes' or 'no'.
Radio button – We use it as an option
button that is a graphical control
element. The radio button allows the
user to select only a single predefined
set of mutually unique options.
Dropdown list – A Dropdown
list is a graphical control
element that allows the user to
select a single value from the
list. When it is inactive, it
displays only a single value.
What operations are performed on the WebElement?
To access WebElement, developers need to complete a set of
operations, starting with browser actions until the operations
run on frames.
Browser operations
1. Launch the browser
2. Navigate to specific web page
3. Close the current browser
4. Close every browser opened by WebDriver at the
time of execution
5. Maximize browser
6. Refresh the browser
Web Page Operations
o Get the page Title
o Get the URL of the page
Edit Box Operations
1.Enter a value
2.Get the value
3. Delete the value
Link operations
o Click link
o Return the link name
Button operations
o Enable button
o Display status
Image Operations
o General image with no functionality
o Clickable image button
o Redirecting image link
Text area operations
Return or capture the messages received from the web
page
Checkbox operations
Tick the checkbox
Undo the checkbox
Radio button operations
Choose radio button
Determine if it shows the radio button
Drop down operations
Choose an item from the list
Get the item count
Frame operations
Switch from top window to specific web page frame
Switch to frame to top window
Given below is the list of different elements that can
be helpful in Selenium automation testing.
 SPEED CONTROLLER : While talking about the Selenium IDE, the speed
controller is used to control the speed of showing that how fast a test case runs.
You can run tests cases and then slow them down to run the test cases.
 RUN ALL BUTTON: We use this to run the entire suite. In many cases, when
you run the test cases for your software applications, you only need to open the
test suite and then press the hit button. In many cases, it will run the 5 test
cases one by one.
 RUN BUTTON: We use this to run the selected test case.
Given below is the list of different elements that can
be helpful in Selenium automation testing.
 PAUSE/ RESUME BUTTON: We use the pause button to pause the running test
cases, and we use the resume button to restart the pausing process.
 STEP BUTTON: We use this to run the test commands manually by using the test
run commands all one by one. In that case, you need to pause your test cases and
then run the commands all one by one with the help of a step button. We generally
use it to debug the script in the Selenium IDE.
 RECORD/STOP BUTTON: We use this to record the user's navigation browser that
would help in navigating the web browsers at a relatively easy pace. We use this
button to stop the working of any specified function.
End of session for this period

More Related Content

PPTX
Selenium.pptx
DOCX
Selenium introduction and some feautures
DOC
Selenium Automation Using Ruby
PPTX
Selenium web driver
PDF
Selenium Testing The Complete Step-by-Step Tutorial.pdf
PDF
Selenium Automation Testing - A Complete Guide.pdf
PPTX
automation with python and selenium
PDF
Selenium for Tester.pdf
Selenium.pptx
Selenium introduction and some feautures
Selenium Automation Using Ruby
Selenium web driver
Selenium Testing The Complete Step-by-Step Tutorial.pdf
Selenium Automation Testing - A Complete Guide.pdf
automation with python and selenium
Selenium for Tester.pdf

Similar to Lesson2-Selenium installation 2-6-25.pptx (20)

PDF
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
PPTX
Selenium- A Software Testing Tool
PPT
Selenium
PPT
Selenium Basics by Quontra Solutions
PPTX
Selenium Training in Chennai Demo Part-2
PPTX
Selenium Testing
PPTX
Test Automation Using Selenium
PPT
Selenium Concepts
PDF
Selenium Tutorial
PDF
Selenium Automation Testing - A Complete Guide.pdf
PDF
Selenium -Test automation for web applications
PDF
Selenium Automation Testing - A Complete Guide
PPT
Selenium
PPTX
Selenium.pptx
PPTX
Selenium training
PDF
Selenium - Introduction
PDF
Intelligent Testing Tool: Selenium Web Driver
DOCX
What is selenium
PPTX
Controlling the browser through python and selenium
PDF
Selenium documentation 1.0
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
Selenium- A Software Testing Tool
Selenium
Selenium Basics by Quontra Solutions
Selenium Training in Chennai Demo Part-2
Selenium Testing
Test Automation Using Selenium
Selenium Concepts
Selenium Tutorial
Selenium Automation Testing - A Complete Guide.pdf
Selenium -Test automation for web applications
Selenium Automation Testing - A Complete Guide
Selenium
Selenium.pptx
Selenium training
Selenium - Introduction
Intelligent Testing Tool: Selenium Web Driver
What is selenium
Controlling the browser through python and selenium
Selenium documentation 1.0
Ad

Recently uploaded (20)

PPTX
History, Philosophy and sociology of education (1).pptx
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
Computing-Curriculum for Schools in Ghana
PDF
Weekly quiz Compilation Jan -July 25.pdf
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
RMMM.pdf make it easy to upload and study
PPTX
Introduction to Building Materials
PPTX
Digestion and Absorption of Carbohydrates, Proteina and Fats
PPTX
Orientation - ARALprogram of Deped to the Parents.pptx
PDF
SOIL: Factor, Horizon, Process, Classification, Degradation, Conservation
PPTX
Lesson notes of climatology university.
PPTX
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PPTX
Radiologic_Anatomy_of_the_Brachial_plexus [final].pptx
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PPTX
A powerpoint presentation on the Revised K-10 Science Shaping Paper
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
1_English_Language_Set_2.pdf probationary
PDF
Empowerment Technology for Senior High School Guide
History, Philosophy and sociology of education (1).pptx
A systematic review of self-coping strategies used by university students to ...
Computing-Curriculum for Schools in Ghana
Weekly quiz Compilation Jan -July 25.pdf
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
RMMM.pdf make it easy to upload and study
Introduction to Building Materials
Digestion and Absorption of Carbohydrates, Proteina and Fats
Orientation - ARALprogram of Deped to the Parents.pptx
SOIL: Factor, Horizon, Process, Classification, Degradation, Conservation
Lesson notes of climatology university.
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
Chinmaya Tiranga quiz Grand Finale.pdf
Radiologic_Anatomy_of_the_Brachial_plexus [final].pptx
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
A powerpoint presentation on the Revised K-10 Science Shaping Paper
Final Presentation General Medicine 03-08-2024.pptx
1_English_Language_Set_2.pdf probationary
Empowerment Technology for Senior High School Guide
Ad

Lesson2-Selenium installation 2-6-25.pptx

  • 1. Selenium Webdriver – Installation and Web elements Using Python
  • 2. Here the steps • The installation and setup of Selenium webdriver in Python can be done with the steps listed below − • Step 1 Navigate to the site having the below link − − • https://www.python.org/downloads/ • Step 2 Click on the Download Python <version number> − button.
  • 4. Step 3 The executable file for Python should get − downloaded in our system. On clicking it, the Python installation page should get launched.
  • 5. • Step 4 Python should be downloaded in the following − path: • C:Users<User>AppDataLocalProgramsPython Python<version> • Step 5 For the Windows users, we have to configure the − path of the Python and the Scripts folder (created inside the Python folder) in the Environment variables.
  • 6. Step 6 To check if Python has successfully installed, execute the − command − py --version. The Python version should get displayed. Step 7 For the Selenium bindings installation, run the command − mentioned below − py –m pip install selenium. Step 8 A new folder called the Selenium should now be generated − within the Python folder (look inside the Lib folder). To upgrade to the latest Selenium version, run the command given below − Py –m pip install selenium. Step 9 To verify if Selenium has been installed properly, execute the − command mentioned below − Py –m pip show Selenium. Step 10 Next, we have to download the Python editor called PyCharm − from the below link − https://www.jetbrains.com/pycharm/ Step 11 Click on Download. −
  • 7. Step 12 For Selenium webdriver in Python, click on the Download button which is below − the Community version (free for use).
  • 9. Step 13 After installation of PyCharm, we have to create a new − project from File -> New Project -> Give a project name, say pythonProjectTest. Then, click on Create. Step 14 We have to create a Python package by right-clicking on the − new project we created in Step13, click on New then select Python Package. Give a package name, say SeleniumTest and proceed.
  • 10. Step 15 We have to create a Python file by right-clicking on the new package we created in Step 14, − click on New then select Python File. Give a package name, say test1.py and proceed.
  • 11. Step 16 To view the Selenium packages in our − project, click on External Libraries and then expand the site-packages folder.
  • 12. How to Install PIP on Windows ? Python is a widely-used general-purpose, high-level programming language. Python is a programming language that lets you work quickly and integrate systems more efficiently. PIP is a package management system used to install and manage software packages/libraries written in Python. These files are stored in a large “online repository” termed as Python Package Index (PyPI). pip uses PyPI as the default source for packages and their dependencies. So, whenever you type: pip install package_name pip will look for that package on PyPI and if found, it will download and install the package on your local system.
  • 13. Check if Python is installed Run the following command to test if python is installed or not. If not click here. python --version Download and Install pip The PIP can be downloaded and installed using the command line by going through the following steps: Method 1: Using cURL in Python Curl is a UNIX command that is used to send the PUT, GET, and POST requests to a URL. This tool is utilized for downloading files, testing REST APIs, etc. Step 1: Open the cmd terminal Step 2: In python, a curl is a tool for transferring data requests to and from a server. Use the following command to request:
  • 15. Let’s talk about Selenium Selenium is an open-source automated testing suite used by developers for creating web applications across multiple browsers and platforms. Selenium focuses on automating web-based applications. Developers are like to perform testing with
  • 16. There are four key components of it:  Selenium IDE  WebDriver  Selenium Remote Control  Selenium Grid
  • 17. Web Element in Selenium Anything available on the webpage is a Web Element, such as a button, scroller, text box, etc. Selenium WebDriver represents a DOM element, and we create all the documents Web Element for an HTML element
  • 18. There are several techniques with which the WebDriver can detect the Web Element, which are dependent on unique properties, like ID, Name, XPath, Class, CSS Selectors, Tagname, link Test, etc.
  • 19. Two main methods offered by WebDriver to find the webpage elements a FineElement() FindElements()
  • 20. Types of Web Elements: Edit Box - This is a basic text control that allows us to enter a small amount of text. Button – It is a clickable button that we can use in different forms and places in the document that requires a standard, easy-to-use button functionality. Link – A link is known as a hyperlink that connects one web page to another. Users can click on that link to navigate from page to page.
  • 21. Types of Web Elements: Image, image button, and image link - It helps to perform various actions on images like clicking on the image button or image link. Text Area - We use this element to enter a plain text editing control that includes multiple lines. Checkbox - The checkbox is a selection box or a tick box element made of a small interactive box that we can mark to indicate 'yes' or 'no'. Radio button – We use it as an option button that is a graphical control element. The radio button allows the user to select only a single predefined set of mutually unique options. Dropdown list – A Dropdown list is a graphical control element that allows the user to select a single value from the list. When it is inactive, it displays only a single value.
  • 22. What operations are performed on the WebElement? To access WebElement, developers need to complete a set of operations, starting with browser actions until the operations run on frames.
  • 23. Browser operations 1. Launch the browser 2. Navigate to specific web page 3. Close the current browser 4. Close every browser opened by WebDriver at the time of execution 5. Maximize browser 6. Refresh the browser
  • 24. Web Page Operations o Get the page Title o Get the URL of the page
  • 25. Edit Box Operations 1.Enter a value 2.Get the value 3. Delete the value
  • 26. Link operations o Click link o Return the link name
  • 27. Button operations o Enable button o Display status
  • 28. Image Operations o General image with no functionality o Clickable image button o Redirecting image link
  • 29. Text area operations Return or capture the messages received from the web page Checkbox operations Tick the checkbox Undo the checkbox Radio button operations Choose radio button Determine if it shows the radio button
  • 30. Drop down operations Choose an item from the list Get the item count Frame operations Switch from top window to specific web page frame Switch to frame to top window
  • 31. Given below is the list of different elements that can be helpful in Selenium automation testing.  SPEED CONTROLLER : While talking about the Selenium IDE, the speed controller is used to control the speed of showing that how fast a test case runs. You can run tests cases and then slow them down to run the test cases.  RUN ALL BUTTON: We use this to run the entire suite. In many cases, when you run the test cases for your software applications, you only need to open the test suite and then press the hit button. In many cases, it will run the 5 test cases one by one.  RUN BUTTON: We use this to run the selected test case.
  • 32. Given below is the list of different elements that can be helpful in Selenium automation testing.  PAUSE/ RESUME BUTTON: We use the pause button to pause the running test cases, and we use the resume button to restart the pausing process.  STEP BUTTON: We use this to run the test commands manually by using the test run commands all one by one. In that case, you need to pause your test cases and then run the commands all one by one with the help of a step button. We generally use it to debug the script in the Selenium IDE.  RECORD/STOP BUTTON: We use this to record the user's navigation browser that would help in navigating the web browsers at a relatively easy pace. We use this button to stop the working of any specified function.
  • 33. End of session for this period