Showing posts with label python. Show all posts
Showing posts with label python. Show all posts

Thursday, 19 September 2013

Python | Eclipse | PyDev | Selenium

Configure PyDev in Eclipse

1| Install PyDev plugin in Eclipse
Help > Install New Software...
2| Click Add and type http://pydev.org/updates
3| Select the check box, 'PyDev' and press Next.

Note:
By default, Aptana Studio has inbuilt PyDev installed; Other steps are similar to Eclipse.



4| Go to Windows > Preferences > Interpreter - Python


5| Click on 'New' and Locate python.exe  "C:\Python27\python.exe"




6| Create a New Python Project  
Right click on package Explorer > New > others
7| Type 'PyDev Project'.
8| Select 'PyDev Project' and press Finish.


9| Create a new Python package.


10| Create a new PyDev module.
Right click on package > New > PyDev module



11| Develop your python selenium script and execute Tests ;)


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