I know how to use Selenium, but have never used Katalon Studio. Need to test accessibility tools with the use of axe extension.
Asked
Active
Viewed 267 times
1 Answers
0
How to use Selenium with Katalon?
Katalon is already built on top of Selenium, but if you wish to use Selenium commands directly in order to allow for more flexibility, you can do it.
Here is what you have to do:
- Import Driver Factory class:
import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory
- After you instantiate a driver session with
WebUI.openBrowser('')
, useDriverFactory
to save that into a variable:
WebUI.openBrowser('')
WebDriver driver = DriverFactory.getWebDriver()
- And now you can use Selenium methods:
driver.get("https://arseblog.news/")
driver.findElement(By.id("searchsubmit")).click()
The complete example script, together with all of the imports:
import org.openqa.selenium.WebDriver
import org.openqa.selenium.chrome.ChromeDriver
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory
import org.openqa.selenium.By
WebUI.openBrowser('')
WebDriver driver = DriverFactory.getWebDriver()
driver.get("https://arseblog.news/")
driver.findElement(By.id("searchsubmit")).click()

Mate Mrše
- 7,997
- 10
- 40
- 77