Start with Python WebDriver - Procedure to create first test script for the beginners


   1. Python should be installed and set up path in your machine.Download Python from here “ClickHere
   2. Install easy_install using code from link "Click to download" .Just copy code from url and past in a new      created python file like “”
  3. Put “” file in where python installed and run “” file as below command
  4. After successfully execution a Scripts folder created under Pyhon installed directory. setup “Script”    folder path in your machine.
  5. Install selenium 2 in your system using command: > easy_install selenium

How to create and Run scripts:

Now your system is ready to execute python webdriver scripts. Copy and past below code in  python file like “”

from selenium import webdriver
from import By
from import Select
from selenium.common.exceptions import NoSuchElementException
import unittest, time, re

class GoogleTest(unittest.TestCase):
    def setUp(self):
        self.driver = webdriver.Firefox()
        self.base_url = ""
        self.verificationErrors = []        
    def test_untitled(self):
        driver = self.driver
        driver.get(self.base_url + "/")
    def tearDown(self):
        self.assertEqual([], self.verificationErrors)

if __name__ == "__main__":

Open command prompt go to scripts directory and run command “python” 
After successfully execution your screen should be look like blow screen..


  1. Hi

    I am using selenium Python wedriver and I need to read data from xls file and fill in the webpage, Can you please help me out with the exact connection code in python.

  2. I am a novice automation tester
    I want to know how do we can generate a html report by using python and selenium test execution


Leave your comments, queries, suggestion I will try to provide solution