Selenium Testing - Python Selenium WebDriver Environment Setup

  • Posted on: 7 January 2019
  • By: admin

In this post, we will predominantly talk about Python Selenium WebDriver setup required to begin composing python selenium contents. Selenium WebDriver can communicate with a wide range of Web programs accessible like Firefox, Internet Explorer, Safari, and Chrome, and so forth utilizing separate programs local driver.

Selenium WebDriver is a standout amongst the most mainstream test computerization instrument for Web UI Automation. This Web UI Automation incorporates programmed execution of the activities performed in an internet browser window like exploring to a site, tapping on connections and catches, filling frames with content boxes, check boxes, radio catches and drop downs, exploring through pages, dealing with pop-ups, etc.

Selenium is an open source library and is accessible in various programming dialects to play out the Web UI Automation testing. Python is one of the selenium bolstered dialect. Selenium WebDriver library for Python empowers to use every one of the highlights accessible with Selenium WebDriver to perform computerized testing Selenium Training in Bangalore of program based applications.

Python Selenium WebDriver library is good with all Python variants from Python2.6 to most recent adaptations. The following are the 4 stages that should be pursued to setup condition for Python Selenium WebDriver.

• Install Python
• Install Selenium WebDriver Package for Python
• Select and setup Python Editor
• Download Browser drivers

Introduce Python:

Python is as a matter of course introduced on Linux disseminations, MAC OS X, and Unix machines. Anyway it should be introduced independently on Windows machines.
Python installer likewise introduces device which is Python's bundle administrator. It encourages the establishment of other required bundles like Selenium Webdriver.

Introduce Selenium WebDriver Package for Python:

There are two diverse approaches to set up Selenium Webdriver with Python.

First technique, use installer instrument to introduce python.

• pip introduce selenium

This methodology is favored among every one of the techniques accessible for introducing Selenium with Python. The above directions will set up the Selenium WebDriver library on the framework with all modules and classes required to make robotized test contents utilizing Python.

The apparatus will naturally download the most recent rendition of the Selenium bundle and introduce it on your machine. To download explicit forms of selenium variant, use beneath order.

• pip introduce selenium==3.11.0

There is a discretionary - U signal; passing this banner will redesign the current form of the introduced bundle to the most recent adaptation.

• pip introduce - U selenium

Second strategy is to physically download source code and run setup python content accessible inside source code organizer.
Download the compress document, extricate the source, go into the envelope and keep running underneath direction.

• python setup.py introduce

Select and setup Python Editor:

After Python and Selenium WebDriver set up, next essential advance is to either pick an editorial manager or an IDE (Integrated Development Environment) for composing the test contents. A decent manager or an IDE makes coding basic and codes quicker with its in-fabricated highlights.

What do we anticipate from an IDE?

• GUI based code manager with Code Completion highlight
• Punctuation featuring highlight
• Code voyager for capacities and classes
• Refactoring
• Choice for overseeing venture structure
• Troubleshooting devices
• Unit testing support

Word processors like Vim, Notepad or Subulime Text can be utilized to compose the Python test contents. Be that as it may, IDEs are progressively advantageous to take a shot at huge tasks.

A portion of the well known Python IDEs for advancement:

1. PyCharm
2. PyDev
3. Visual Studio
4. Spyder

Download Browser drivers:

The greatest change in Selenium as of late has been the consideration of the WebDriver API. Driving a program locally as a client would either locally or on a remote machine utilizing the Selenium Server it denotes a jump forward regarding program mechanization.

Selenium WebDriver fits in indistinguishable job from RC did, and has fused the first 1.x ties. It alludes to both the dialect ties and Selenium courses in Bangalore the executions of the individual program controlling code. This is generally alluded to as just "WebDriver" or once in a while as Selenium 2.

Selenium 1.0 + WebDriver = Selenium 2.0

WebDriver is structured in a more straightforward and increasingly brief programming interface alongside tending to a few constraints in the Selenium-RC API. WebDriver is a conservative Object Oriented API when contrasted with Selenium1.0

It drives the program substantially more adequately and conquers the impediments of Selenium 1.x which influenced our utilitarian test inclusion, similar to the document transfer or download, pop-ups and exchange obstruction WebDriver defeats the confinement of Selenium RC's Single Host birthplace approach. You can download webdriver executable from particular program driver vaults.