Batch file 在批处理文件中运行Selenium
我想创建一个用于运行Selenium的批处理文件。我需要它在Jenkins中运行它,现在您可以问为什么要使用批处理文件?它有一个插件,所以使用这个插件。现在不可能使用该插件,因为它很复杂,所以我需要使用批处理文件 我正在使用selenium-java-2.20.0和Firefox 已经谢谢你了 这是我得到的代码和错误:Batch file 在批处理文件中运行Selenium,batch-file,selenium-rc,Batch File,Selenium Rc,我想创建一个用于运行Selenium的批处理文件。我需要它在Jenkins中运行它,现在您可以问为什么要使用批处理文件?它有一个插件,所以使用这个插件。现在不可能使用该插件,因为它很复杂,所以我需要使用批处理文件 我正在使用selenium-java-2.20.0和Firefox 已经谢谢你了 这是我得到的代码和错误: C:\Users\User\Desktop>@echo off C:\Users\User\Desktop>java -jar C:\Users\User\Down
C:\Users\User\Desktop>@echo off
C:\Users\User\Desktop>java -jar C:\Users\User\Downloads\selenium-java-2.20.0\selenium-2.20.0\selenium-java-2.20.0.jar -htmlSuite "iexploreproxy" "http://localhost" "C:\Users\User\Documents\Runner.html" "C:\Reports\Selenium\result.html"
Failed to load Main-Class manifest attribute from C:\Users\User\Downloads\selenium-java-2.20.0\selenium-2.20.0\selenium-java-2.20.0.jar
您使用了错误的JAR文件。你想要。顺便说一下,可能是“C:\Users\User\Documents\ISAAC\Test Mogelijkheden\Selenium\Runner.html”中Test和MogelijkhedenIt的
@echo off
之间的空格,不是echo@off
@reos我把它改为:C:\Users\User\Desktop>@echo-off C:\Users\User\Desktop>java-jar C:\Users\User\Downloads\selenium-java-2.20.0\selenium-java-2.20.0.jar-htmlSuite“iexploreproxy”“”C:\Users\User\Documents\Runner.html“C:\Reports\selenium\result.html”未能从C:\Users\User\Downloads\selenium-java-2.20.0\selenium-2.20.0\selenium-java-2.20.0.jar加载主类清单属性,但仍然收到错误。该错误表示您尝试运行的jar文件不是可执行jar文件。@adarshr但我认为这很奇怪。这意味着Selenium不能通过命令行作为服务器运行。我去了seleniumhq.org/download/,从Selenium服务器(以前的Selenium-RC服务器)那里下载了2.20.0失败!xD哦,我的天。。谢谢你,伙计!