How to stop the Selenium server from an Ant task that I forked for the purpose of "java"?

I wrote an Ant target that starts the Selenium server, runs my test code, and then ... I would like it to stop the forked process (Selenium). How do I track this forked stream created for Ant to stop it?

+3
source share
2 answers

You should be able to disable the selenium server with direct web request to

http: // localhost: 4444 / selenium-server / driver /? cmd = shutDownSeleniumServer

The http get task will do this.

+5
source

[Here ant target:]

 <target name="stop-server">
    <get taskname="selenium-shutdown" src="http://localhost:4444/selenium-server/driver/?cmd=shutDownSeleniumServer"
    dest="result.txt" ignoreerrors="true" />
    <echo taskname="selenium-shutdown" message="DGF Errors during shutdown are expected" />
</target>
+2
source

Source: https://habr.com/ru/post/1781382/


All Articles