Showing posts with label selenium grid. Show all posts
Showing posts with label selenium grid. Show all posts

Tuesday, 17 April 2012

How to stop selenium Grid from Ant build?


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




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

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


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.