- What is Python?
- How to Install Python?
- Python Variables and Operators
- Python Loops
- Python Functions
- Python Files
- Python Errors and Exceptions
- Python Packages
- Python Classes and Objects
- Python Strings
- PostgreSQL Data Types
- Python Generators and Decorators
- Python Dictionary
- Python Date and Time
- Python List and Tuples
- Python Multithreading and Synchronization
- Python Modules
- What is Python bytecode?
- Python Regular Expressions
- Selenium Basics
- Selenium with Python Introduction and Installation
- Navigating links using get method Selenium Python
- Locating Single Elements in Selenium Python
- Locating Multiple elements in Selenium Python
Interview Questions & Answers
Selenium with Python Introduction and Installation
Selenium is an open-source research platform, but without investing money, it can be downloaded from the internet. Selenium is a platform for practical testing and is therefore compliant with non-functional testing devices. The Python Module of Selenium is configured to do automated Python checking. Selenium Python bindings are supported by a fast API to write practical acceptance tests using Selenium WebDriver. You can navigate all the Selenium WebDriver functionality in an elegant way via the Selenium Python API.
Selenium Python Introduction
Selenium Python bindings include a simple API for accessing Firefox, Internet Explorer, Chrome etc. via Selenium WebDrivers. The latest versions of Python that are supported are 2.7, 3.5 and above.
Combination of tool and DSL:
Selenium is a blend of tools and DSL to run different types of checks.
Easier to understand and implement:
Selenium commands are listed in terms of multiple classes, making it easy to recognise and execute them.
Lesser resources required:
Compared to its rivals like UFT, RFT, etc., Selenium needs fewer energy.
Open Source and Portable:
Selenium is a Web testing application that is open source and scalable.
Parallel Test Execution:
It also encourages the execution of concurrent experiments, which decreases time and improves test performance.
Installation of Selenium Python Setup
Once the python is installed on your personal computer, Selenium can be installed on any operating system like, Windows, Linux, and mac OS.
Open Terminal/Command prompt and Write as described below.
python -m pip install selenium
Alternatively, here you can uninstall the root distribution, unarchive it, and execute the following command:
python setup.py install
Firefox, Chromium, PhantomJs(Obsolete Now), etc. can be mounted.
- You can need to update GeckoDriver to use Firefox.
- You will need to update Chromium to use Chrome browser.
Steps for Linux Operating System(OS):
- Go to the release page for Geckodriver. Find the platform’s new version of the driver and update it.
Extract the file by using
chmod +x geckodriver
Paste Files to user/local/bin
sudo mv geckodriver /user/local/bin/
Installation setup for windows operating system:
- Same as Linux Stage 1 Download the GeckoDriver Driver
- Using WinRar or other programme you might have, extract it.
- Using Command Prompt to connect it to Route
setx path “%path%;GeckoDriver Path”
setx path “%path%;c:/user/Archit/Desktop/geckodriver-v.28.0-win64/geckodriver.exe”
Creating Simple Program in selenium python
# import webdriver from selenium import webdriver # webdriver object driver = webdriver.Firefox() # get google.co.in driver.get("https://google.co.in")