您可以创建一个指向您的testng.xml文件的bash文件。
使用此: Bash file is running fine in windows for testng but it is not working in linux/mac
步骤: -
1. Create a notepad file
2. Copy -> java -cp ./src/lib/*:./bin org.testng.TestNG testng.xml(use ; instead of : if you are using windows) (./src/lib/* -> All your jars files must present in this location, ./bin -> all your class files must be present here)
3. save the file.
4. Rename the file as something.bat
5. Double click on file if you are using windows or use **bash filename** if using linux or mac
注: - Java的,需要的浏览器必须出现在其他计算机和它的是什么,与你的自动化脚本运行的先决条件。他们必须预先安装
完全相同的方式。最好使用构建脚本将代码和库和资源文件打包到一个JAR中,然后直接在目标机器上执行该脚本。 Google Maven或Gradle获取更多信息。 – xaviert
我已经创建了一个我的项目的zip文件,那么如何使用xml文件执行它 –
您不能使用您的XML文件_execute_该ZIP文件。使用命令行(就像你已经做过的那样)或者使用bash/shell脚本来使用ZIP文件和XML文件调用'java ...'命令。 – xaviert