Archive

Archive for March, 2011

How to stop selenium Grid from Ant build?

March 18, 2011 8 comments

How to stop selenium Grid from Ant build?

This is also a very simple process as similar to starting the Selenium Grrid from a bat/sh file[mentioned here].

First of all we need to create a bat/file with either of following commands

curl -d action=shutdown http://localhost:4444/lifecycle-manager
or

wget --post-data action=shutdown action=shutdown http://localhost:4444/lifecycle-manager

Save the bat file in the Selenium Grid base directory. Double check bat file whether its working fine by double clicking on that[pre condition : Selenium Hub and RCs must started before].

I am using this way because there is no default ant target for shutting down the Selenium Grid.

Coming to Ant Build, we need to create a custom ant target in build.xml to execute the above bat file. It look like

<target name=”stopGrid”>
<exec dir=”${grid.dir}” executable=”cmd” os=”Windows XP”>
<arg line=”/c stopGrid.bat”/>
</exec>
</target>

Save the build.xml and execute target as ‘ant stopGrid‘.

Happy testing…

How to start Selenium Grid hub and RCs with one click.

March 18, 2011 2 comments

How to start Selenium Grid hub and RCs with one click.

Its a so simple process. We can done it by creating a bat/sh file.  Here is the steps

Open a notepad and enter following

start /B ant launch-hub
start /B ant -Denvironment=”*firefox” -Dport=5555  -DhubURL=http://localhost:4444 launch-remote-control
start /B ant -Denvironment=”*iehta” -Dport=5557  -DhubURL=http://localhost:4444 launch-remote-control

Save the notepad as bat file in Selenium Grid base directory.  Double click on the bat file and it will start Hub and RCs.

Categories: Selenium, Selenium Grid
%d bloggers like this: