Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.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 从CMD运行seleniumide测试用例_Java_Selenium_Selenium Ide - Fatal编程技术网

Java 从CMD运行seleniumide测试用例

Java 从CMD运行seleniumide测试用例,java,selenium,selenium-ide,Java,Selenium,Selenium Ide,我准备从命令行运行Selenium IDE测试用例,并使用以下命令将结果重定向到日志文件: java -jar C:\Selenium\selenium-server-standalone-2.41.0.jar -multiwindow -htmlSuite "*firefox" "http://newtours.demoaut.com" "C:\Selenium\Invalid_Login.html" "C:\selenium\logs\hi.html" 我使用*.bat文件运行上面的代码

我准备从命令行运行Selenium IDE测试用例,并使用以下命令将结果重定向到日志文件:

java -jar C:\Selenium\selenium-server-standalone-2.41.0.jar -multiwindow  -htmlSuite "*firefox" "http://newtours.demoaut.com" "C:\Selenium\Invalid_Login.html" "C:\selenium\logs\hi.html"
我使用*.bat文件运行上面的代码,但它对我不起作用,因为它只是打开firefox向我显示IDE窗格和代码,而没有运行它

你能帮忙吗


谢谢大家!

首先,您需要在
C:\Selenium\
文件夹中包含以下所有内容:

  • selenium服务器单机版
    .jar
    文件
  • YourTestSuite.html
  • YourTestCase.html
  • .bat
    使用您(或多或少)提到的命令创建的文件
java-jar C:\Selenium\Selenium-server-standalone-2.41.0.jar-htmlSuite“*firefox”http://newtours.demoaut.com“C:\Selenium\YourTestSuite.html”“C:\Selenium\logs\hi.html”

解决安装故障的步骤:

  • 因为我不知道它是什么,所以请确保
    Invalid_Login.html
    实际上是您的测试套件,而不是您的测试用例
  • 根据您的浏览器版本使用selenium server独立jar文件版本。对于最新版本的浏览器,您需要在测试中使用最新的selenium server独立jar文件

  • 当您在命令行而不是批处理文件中运行该命令时,该命令是否有效?是的,它必须是套件文件,而不是测试文件。再检查一遍。