QA/Execution/Web Testing/Docs/Automation/Selenium/RC
< QA | Execution | Web Testing | Docs/Automation
Setting up and Running with Selenium Remote Control
Setting Up Selenium RC for Python
- Download the Selenium RC zip file from the Selenium org 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.
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. [1]
- Install PEAR [2]
- Install PHPUnit [3]
- Install Selenium RC 1.0.3 (current release) [4]
- 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.
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.
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.
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.
- To run a script enter
python myscript
where myscript is the script file. More info on Python command line options here.
- To start a script in the debugger enter
python -m pdb myscript
where myscript is the script file. More information about the debugger here.
From an IDE
After lots of configuring for the particular IDE, push the magic Run or Debug button. Very popular.