【发布时间】:2016-05-29 05:52:52
【问题描述】:
我是 selenium webdriver 的新手,我想在 windows 服务器上安排我的测试。所以我打算创建一个 .bat 文件并使用 Windows 调度程序。这是我的bat文件。请帮我解决这个问题
projectLocation=E:\Automation\Webdrive 项目\HTML5
cd %projectLocation%
设置类路径=%projectLocation%\bin;%projectLocation%\lib*
java org.testng.TestNG %projectLocation%\testng.xml
暂停
当我运行代码时出现一些错误。
C:\Users\miskinr\Desktop set projectLocation=E:\Automation\Webdrive project\HTML5
C:\Users\miskinr\Desktop cd E:\Automation\Webdrive project\HTML5
C:\Users\miskinr\Desktop set classpath=E:\Automation\Webdrive project\HTML5\bin;
E:\Automation\Webdrive project\HTML5\lib\*
C:\Users\miskinr\Desktop java org.testng.TestNG E:\Automation\Webdrive project\HTML5\testng.xml
java.io.FileNotFoundException: E:\Automation\Webdrive (The system cannot find the file specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(Unknown Source)
at java.io.FileInputStream.<init (Unknown Source)
at java.io.FileInputStream.<init (Unknown Source)
at org.testng.xml.Parser.parse(Parser.java:167)
at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:300)
at org.testng.TestNG.run(TestNG.java:1021)
at org.testng.TestNG.privateMain(TestNG.java:1355)
at org.testng.TestNG.main(TestNG.java:1324)
java.io.FileNotFoundException:
C:\Users\miskinr\Desktop\project\HTML5\testng.xml
(The system cannot find the path specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(Unknown Source)
at java.io.FileInputStream.<init (Unknown Source)
at java.io.FileInputStream.<init (Unknown Source)
at org.testng.xml.Parser.parse(Parser.java:167)
at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:300)
at org.testng.TestNG.run(TestNG.java:1021)
at org.testng.TestNG.privateMain(TestNG.java:1355)
at org.testng.TestNG.main(TestNG.java:1324)
【问题讨论】:
标签: batch-file selenium