Here is my run command:
katalonc -runMode=console -projectPath=“D:/project/myproject/myproject.prj” -retry=0 -testSuitePath=“Test Suites/ThuNghiem/LuongMoi_0868602372/TN_Successful_VTP_LuongMoi_2372” -executionProfile=“default” -browserType=“Android” -remoteWebDriverType=“Appium” -deviceId=“R58M7285TMY” -reportFolder=TS_NVVTPay -apiKey=myapiKey
But I want to run each testcase in testsuite, but I can’t find the key for running each testcase by commandline
Can you support us to run the commandline with each testcase?
Let me assume you have 3 test cases TC1, TC2, TC3 and you want to execute these 3 from command line. You can create 3 Test Suites TS1, TS2, TS3 each wraps TC1, TC2, TC3 respectively. When you execute TS3 from command line, effectively you can execute TC3. Silly, but it works.
Or you can use WebUI.callTestCase()
.
You want to create a new Test Case TCX, which will do
switch(GlobalVariable.TestCaseToRun) {
case "A":
WebUI.callTestCase(findTestCase("TC1")
break
case "B":
WebUI.callTestCase(findTestCase("TC2"))
break
case "C":
WebUI.callTestCase(findTestCase("TC3")
break
}
You want a new test suite TSX, which encloses the TCX.
Then in the command line you can execute the TSX while specifying the value of GlobalVariable.TestCaseToRun by
katalonc ... -testSuitePath="TSX" -g_TestCaseToRun="C"
Then TC3 will be executed.
Even shorter TCX could be:
WebUI.callTestCase(findTestCase("Test Cases/" + GlobalVariable.TestCaseToRun))
In the command line you execute:
katalonc ... -testSuitePath="TSX" -g_TestCaseToRun="TC3"