开发者

How do I stop a Selenium server from an Ant task that I forked from a `java` target?

开发者 https://www.devze.com 2023-01-31 08:25 出处:网络
I have written an Ant target that starts Selenium server, runs my test code, and then... I would like it to stop the forked process (Selenium开发者_开发知识库). How do I keep track of that forked thre

I have written an Ant target that starts Selenium server, runs my test code, and then... I would like it to stop the forked process (Selenium开发者_开发知识库). How do I keep track of that forked thread that Ant created in order to stop it?


You should be able to shutdown selenium server with a direct web request to

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

The http get task will do for this.


[Here is the 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>
0

精彩评论

暂无评论...
验证码 换一张
取 消