您可以創建一個指向您的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