hugs (owner)

Revisions

gist: 64827 Download_button fork
public
Description:
Using a PHP interactive prompt utility with Selenium RC makes it easier to debug Selenium tests.
Public Clone URL: git://gist.github.com/64827.git
Embed All Files: show embed
playing with phpsh + selenium rc #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
* Download and open Selenium RC from seleniumhq.org
 
* Download and install phpsh from phpsh.org
        [terminal-1$ sudo ln -s /home/ubuntu/Apps/phpsh/phpsh /usr/local/bin/phpsh
 
* Start Selenium RC Server (in a new terminal window)
        [terminal-2]$ cd /home/ubuntu/Apps/selenium-remote-control-1.0-beta-2/
        [terminal-2]$ cd selenium-server-1.0-beta-2/
        [terminal-2]$ java -jar selenium-server.jar
 
* Go to the Selenium PHP client library directory
        [terminal-1]$ cd /home/ubuntu/Apps/selenium-remote-control-1.0-beta-2/
        [terminal-1]$ cd selenium-php-client-driver-1.0-beta-2/
        [terminal-1]$ ls
        doc GoogleTest.php MockBrowserTest.php PEAR SeleniumTest.php
        TestSuiteHeadless.php TestSuite.php
 
* Launch phpsh
        [terminal-1]$ phpsh
 
* "Hello, Google!"
        php> set_include_path(get_include_path() . PATH_SEPARATOR . './PEAR/');
        php> require_once 'Testing/Selenium.php';
        php>
        php> $selenium = new Testing_Selenium("*firefox", "http://www.google.com");
        php> $selenium->start()
        php> $selenium->open('/')
        php> $selenium->type("q", "hello world")
        php> $selenium->click("btnG")
 
* Cleanup
        php> $selenium->stop()
        php> exit