My use case is: 5 test cases. All need to execute in separate Chrome browser. All need to not close after the script is finished, because last screen need human review.
My solution is as follows:
- Prevent Test suite close browser (Project -> Settings -> Execution -> Terminate driver after each test suite)
Credit: Zazrshima above - Add a new Test Listener
import com.kms.katalon.core.webui.driver.DriverFactory
import org.openqa.selenium.WebDriver
import org.openqa.selenium.chrome.ChromeDriver
class NewTestListener {
@BeforeTestCase
def sampleBeforeTestCase(TestCaseContext testCaseContext) {
// Remember to replace your own Chrome Driver location
System.setProperty("webdriver.chrome.driver", "C:\\SomeWhereInYourDrive\\Katalon_Studio_Windows_64\\configuration\\resources\\drivers\\chromedriver_win32\\chromedriver.exe")
WebDriver driver1 = new ChromeDriver()
DriverFactory.changeWebDriver(driver1)
}
}
Credit: Automate two different sites as part of the same test
-
Remove all the
WebUI.openBrowser('')from all your scripts. -
Add your test cases to the same test suit and execute
-
You should see your test case being executed in different Chrome browser
See if this is useful to anybody, thanks.