|
|
Line 1: |
Line 1: |
| '''Setting up and Running with Selenium Remote Control'''
| | #REDIRECT [[QA/Execution/Web_Testing/Automation]] |
| | |
| === Setting Up Selenium RC for Python ===
| |
| | |
| #Download the Selenium RC zip file from the Selenium org [http://seleniumhq.org/download/ downloads] page. Unzip to a convenient location. | |
| #In the selenium-remote-control-1.0.3\selenium-python-client-driver-1.0.3 directory find the file selenium.py.
| |
| #Copy selenium.py to the Python installation's \Lib directory. For a default Python 2.6 installation this would be c:\Python26\Lib.
| |
| | |
| <br>
| |
| | |
| === Setting Up Selenium RC for PHP & PHPUnit on Mac 10.5 ===
| |
| | |
| # Mac OS X 10.5 (Leopard) comes with both Apache 2.2.6 and PHP 5.2.4 preinstalled, but they're not enabled by default. The following instructions should help you get up and running. '''[http://foundationphp.com/tutorials/php_leopard.php]'''
| |
| # Install PEAR '''[http://stackoverflow.com/questions/628838/how-to-set-up-pear-on-mac-os-x-10-5-leopard]'''
| |
| # Install PHPUnit '''[http://www.phpunit.de/manual/3.0/en/installation.html]'''
| |
| # Install Selenium RC 1.0.3 (current release) '''[http://seleniumhq.org/download/]'''
| |
| <blockquote>
| |
| * Unzip
| |
| * Move the selenium-remote-control folder from your Downloads folder to /Users/<username>/MyApps folder (create a MyApps folder)
| |
| * Move/Copy ''MyApps/selenium-remote-control-1.0.3/selenium-php-client-driver-1.0.3/PEAR/Testing'' folder to ''/usr/local/PEAR'' folder.
| |
| </blockquote>
| |
| | |
| <br>
| |
| | |
| === Starting the RC server ===
| |
| | |
| ==== In Windows ====
| |
| | |
| #Open a command window and change directories to selenium-remote-control-1.0.3/selenium-server-1.0.1 directory. It should contain selenium-server.jar.
| |
| #From the command prompt enter ''java -jar selenium-server.jar''
| |
| | |
| If the server is running correctly it will print a few lines and ''not'' return to the command line prompt. When a script with Selenium runs the server window will display a few more lines and return to waiting.
| |
| | |
| <br>
| |
| | |
| === Running a Python Selenium script ===
| |
| | |
| ==== In Windows ====
| |
| | |
| ===== Using Python IDLE =====
| |
| | |
| #Launch Python IDLE, which creates a Python Shell window.
| |
| #From the menu select File > Open and select the script from the file browser. The script appears in another window.
| |
| #Check code syntax by selecting Run > Check Module.
| |
| #Run the script by selecting Run > Run Module. Results appear in the Python Shell window.<br>
| |
| | |
| ===== From command window =====
| |
| | |
| *Note: The Python installer does not change the ''path'' environment variable which allows the python to run from anywhere. Update from Start > Control Panel > System > Advanced tab > Environment Variables button. From the System Variables list highlight ''path'' and select Edit. Add your Python installation directory, for example c:\Python26 for the default installation, remembering to include semi-colon ( ; ) between it and the existing list. Select OK in the dialogs to save. Value applies to new command windows.<br>
| |
| *To run a script enter<br>
| |
| <blockquote>python ''myscript''<br> where ''myscript'' is the script file. More info on Python command line options [http://docs.python.org/using/cmdline.html here].<br> </blockquote>
| |
| *To start a script in the debugger enter<br>
| |
| <blockquote>python -m pdb ''myscript''<br> where ''myscript'' is the script file. More information about the debugger [http://docs.python.org/library/pdb.html here]. </blockquote>
| |
| | |
| ===== From an IDE =====
| |
| After lots of configuring for the particular IDE, push the magic Run or Debug button. Very popular.
| |