1
votes

i have a selenium grid2 hub running and 2 nodes attached (node a and node b) . How do i use them? How do i run test on more then one node at a time? i have the feeling i am missing something obvious.

if have tried this:

phpunit tests/phpunit/GUI/

there a 2 test cases (RegTest, LoginTest) both a executed (in sequence) but only on one node. (node a) the second node is not touched once.

what am i missing?

node a (ubuntu) java -jar selenium-server-standalone-2.18.0.jar -role node  -hub http://localhost:4444/grid/register
node b (xp) java -jar selenium-server-standalone-2.18.0.jar -role node  -hub http://localhost:4444/grid/register

both nodes have firefox installed. i am connecting to the hub using this call:

$this->oWebDriver = new WebDriver( self::SELENIUM_SERVER, self::SELENIUM_SERVER_PORT);
$this->oWebDriver->connect('firefox');

this php webdriver: http://code.google.com/p/php-webdriver-bindings/

1

1 Answers

1
votes

so here we are 2 weeks later. With some extended reading and more brainpower i was able to figure it out for myself.

you can easily use more then one node starting more then one phpunit test at a time. Problem is phpunit tests (3.6) are pretty much running one after another. You can use ant (or similar tools) to bypass this problem. As you can see here: http://jenkins-php.org/

you may use <parallel threadCount="2"> to start parallel tasks , which could be phpunit tests. Still there is the possibilty that not every test is suited to run parallel (e.g if you are loading fixtures into your database in the setUp method)

besides this there is no way (at least i could not found any) to address a particular node over the hub (maybe thats not sense of a hub) but you can use the Capabilities to address sepecif platforms or browser or browser version

if the hub cant find anything that suits your Capabilities it will return an error else it will use one of the browsers thats suits your descriped Capabilities

problem here is that platform is an ENUM field and you have to use it limited values to describe your noced (LINUX, MAX, VISTA, WINDOWS, XP) there is no W7 , and WINDOWS is very greedy. If you have a 2 nodes one with XP and one with WINDOWS and you set WINDOWS in your Capabilities there is a chance the hub will pick XP (as it is a WINDOWS platform) so be aware of that.

.. i think thats all i would have asked for 2 weeks ago (- ;