Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/352.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使用ant文件运行Selenium独立服务器_Java_Ant - Fatal编程技术网

Java 使用ant文件运行Selenium独立服务器

Java 使用ant文件运行Selenium独立服务器,java,ant,Java,Ant,我正在尝试将Selenium独立服务器合并到我的自动化项目的构建文件中。我不知道如何使用ant任务启动一个jar,非常感谢您的帮助。 提前感谢您可以尝试以下方法: <target name="integration-test"> <parallel failonany="true"> <sequential> <exec executable="java"> <a

我正在尝试将Selenium独立服务器合并到我的自动化项目的构建文件中。我不知道如何使用ant任务启动一个jar,非常感谢您的帮助。
提前感谢

您可以尝试以下方法:

<target name="integration-test">
    <parallel failonany="true">
        <sequential>
            <exec executable="java">
                <arg line="-jar selenium-server-standalone.jar" />
            </exec>
        </sequential>
        <sequential>
            <waitfor maxwait="1" maxwaitunit="minute">
                <socket server="localhost" port="4444" />
            </waitfor>
            ...Your integration tests here...
        </sequential>
    </parallel>
</target>

…您的集成测试在此。。。
这将并行启动selenium服务器和您的测试