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.

First Method:

Open Terminal/Command prompt and Write as described below.

python -m pip install selenium

Second Method:

Alternatively, here you can uninstall the root distribution, unarchive it, and execute the following command:

python setup.py install

Installing Webdrivers:

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):
  1. Go to the release page for Geckodriver. Find the platform’s new version of the driver and update it.
  2. For Example:
    	wget 
    	https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz			
    	
  3. Extract the file by using

    tar -xvzfgeckodriver*

  4. Become executable:

    chmod +x geckodriver

  5. Paste Files to user/local/bin

    sudo mv geckodriver /user/local/bin/

Installation setup for windows operating system:
  1. Same as Linux Stage 1 Download the GeckoDriver Driver
  2. Using WinRar or other programme you might have, extract it.
  3. Using Command Prompt to connect it to Route
Learn More Python Tutorial

setx path “%path%;GeckoDriver Path”

Example:

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")
	
Output:
navigation-link-selenium-python
Enroll Yourself: Python Training

Copyright 1999- Ducat Creative, All rights reserved.