Friday 13 September 2013

Python | Selenium

Python set up

1| Download and install Python 2.7

pip is a package management system,  a tool for installing and managing Python packages. easy_install is similar to pip.

Configure easy_install
   2.1| Install setuptools | Windows 32-bit machine 
   2.2| If you're using Windows 64-bit machine, save this ez_setup.py file in local directory and run it.

Configure pip
   3| Save this get-pip.py file into local directory and run it.

4| Install Selenium Python Client Driver
    a| Open cmd prompt
    b| Locate the folder C:\Python27\Scripts in cmd and enter
easy_install selenium
or|
pip install selenium


5| Generate scripts from Selenium IDE.
6| Export Test case as Python 2 / unittest / WebDriver
7| Double click on .py file and execute python test.


Selenium Update for Python

1| Open cmd prompt
2| Locate the folder C:\Python27\Scripts in cmd and enter
pip install -U selenium
or|
pip install selenium==2.40
or|
easy_install -U selenium
3| Setup tools can also be updated [only if needed].
pip install --upgrade setuptools



3 comments: