I am trying to launch chrome driver in between Windows Test execution. I know, I can create separate Tests and create separate test suites and configure in Test Suite Collection.
But my need is to get some data from a Web Page while most of the test would run in a Windows Application.
Any help ?
use this below to launch the browser.
As I mentioned, I am trying to launch web application in windows test. So, above solution will not work since web driver is not initialized by katalon
The following code demonstrates how to open Chrome Browser without calling
WebUI.openBrowser() keyword does almost the same as this internally.
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
DesiredCapabilities options = new DesiredCapabilities()
WebDriver driver = DriverFactory.openWebDriver(WebUIDriverType.CHROME_DRIVER, options)
// you can use any WebUI.* keywords after changeWebDirver(driver)
You can read the source of com.kms.katalon.core.webui.driver.DriverFactory class (though it is very old version) at:
Thanks for your suggestion.
That piece of code did not work for me. I tried debugging and found out that, ‘openWebDriver()’ first looks for the chromedriver in [projectdir]/include/ section. (But Katalon actually keeps it in Installation folder).
When it does not find in that place, it goes to else condition, where it looks for system configuation property. Since, the system configuration is loaded with WINDOWS Preferred configuration, it throws exception.
Let me know if I am missing anything.
Since your Katalon Studio project is set with WINDOWS Prefered configuration, your Katalon Studio is not able to find the binary of ChromeDriver. Therefore you can not rely on Katalon Studio to resolve the location of the binary at runtime when you run your WINDOWS project. This is what you reported, I did not know. Thank you for your investigation.
However, a countermeasure is possible. In order to let your project run successful, you need to find out where the ChromeDriver binary is located. Once you have got it, you can explicitly specify the location string of the binary in your test script.
Q1 How can you find the location of the binary of ChromeDriver?
For research purpose, you want to create a new project of “WebUI configuration”. In that project, you call DriverFactory.getChromeDriverPath, which will return a string. The returned string tells where you can find the ChromeDriver binary bundled in Katalon Studio.
Q2 How can you start up the ChromeDriver while specifying the path of the binary?
See the ChromeDriver manual page.
I can not give you a runnable sample code on your machine, as I am on Mac, not Windows.
com.kms.katalon.core.webui.driver.DriverFactory class is there to let you use the ChromeDriver binary bundled in the Katalon Studio project.
If you do not like hard coding the path of the binary, an alternative is available
This library enables you to download and install the latest ChromeDriver into your machine, outside Katalon Studio’s control, and make it available to your code in Groovy/Java including Katalon Test Case script.
You need to download and place the jar of webdrivermanager in the
Drivers folder as the following doc describes:
Yup, I was also trying to find the binary location of the chrome driver in runtime. Tried debugging in few internal classes. That would be the best solution to sustain on its own for periodical driver update.
Let me try the ones you suggested and get back.
Appreciate your help
is your issue solved ?