Studio 8.2.1.alpha is now available with Selenium 4!

'Tis the Season!

I’m excited to let you know we have just published Katalon Studio version 8.2.1.alpha that has upgraded to Selenium version 4.1.0 and Appium Java Client version 8.0.0-beta.

Download it from our GitHub Repo and give it a shot. You can refer to our blog for the top features of Selenium 4 for trying out.

Happy Testing

Jass

2 Likes

Selenium 4 supported Chrome DevTools Protocol. Chrome DevTools Protocol is also called CDP for short. See this article.

I wanted to use CDP Network commands. For example, I wanted to fetch HTTP Request’s Headers (including Cookies) sent from Chrome to Web server. So I tried to write a Test Case that calls CDP through Selenium.

In Katalon Studio v8.2.1-alpha, I wrote the following Test Case. This script is supposed to retrieve console logs in the DevTools. I copied this from this article

import java.time.Duration;

import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.devtools.DevTools;
import org.openqa.selenium.devtools.v96.log.Log;

import com.kms.katalon.core.webui.driver.DriverFactory

// https://www.qed42.com/insights/coe/quality-assurance/selenium-4-api-chrome-devtools

System.setProperty("webdriver.chrome.driver", DriverFactory.getChromeDriverPath())
ChromeDriver driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));

// try to view DevTools Console Logs
DevTools devTools = driver.getDevTools();
devTools.createSession()
devTools.send(Log.enable())

devTools.addListener(Log.entryAdded(), { logEntry ->
	println("-------------------------------------------")
	println("Request ID = " + logEntry.getNetworkRequestId())
	println("URL = "        + logEntry.getUrl())
	println("Source = "     + logEntry.getSource())
	println("Level = "      + logEntry.getLevel())
	println("Text = "       + logEntry.getText())
	println("Timestamp = "  + logEntry.getTimestamp())
	println("-------------------------------------------");
})

driver.get("https://www.qed42.com/404");

driver.quit()

It worked. It ran and printed the following output

2022-01-03 17:48:29.385 INFO  c.k.katalon.core.main.TestCaseExecutor   - --------------------
2022-01-03 17:48:29.389 INFO  c.k.katalon.core.main.TestCaseExecutor   - START Test Cases/test/Selenium4CDP/CDPViewConsoleLogs
2022-01-03 17:48:30.087 DEBUG testcase.CDPViewConsoleLogs              - 1: System.setProperty("webdriver.chrome.driver", getChromeDriverPath())
2022-01-03 17:48:30.140 DEBUG testcase.CDPViewConsoleLogs              - 2: driver = new org.openqa.selenium.chrome.ChromeDriver()
Starting ChromeDriver 96.0.4664.45 (76e4c1bb2ab4671b8beba3444e61c0f17584b2fc-refs/branch-heads/4664@{#947}) on port 55856
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
1 03, 2022 5:48:33 午後 org.openqa.selenium.remote.ProtocolHandshake createSession
情報: Detected dialect: W3C
1 03, 2022 5:48:33 午後 org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
情報: Found exact CDP implementation for version 96
2022-01-03 17:48:33.970 DEBUG testcase.CDPViewConsoleLogs              - 3: timeouts().implicitlyWait(Duration.ofSeconds(10))
2022-01-03 17:48:34.068 DEBUG testcase.CDPViewConsoleLogs              - 4: devTools = driver.getDevTools()
2022-01-03 17:48:34.073 DEBUG testcase.CDPViewConsoleLogs              - 5: devTools.createSession()
2022-01-03 17:48:34.185 DEBUG testcase.CDPViewConsoleLogs              - 6: devTools.send(Log.enable())
2022-01-03 17:48:34.221 DEBUG testcase.CDPViewConsoleLogs              - 7: devTools.addListener(Log.entryAdded(), { java.lang.Object logEntry -> ... })
2022-01-03 17:48:34.229 DEBUG testcase.CDPViewConsoleLogs              - 8: driver.get("https://www.qed42.com/404")
-------------------------------------------
-------------------------------------------
Request ID = Optional[7D829D787FD04230D68FFB87F39497DF]
Request ID = Optional.empty
URL = Optional[https://www.qed42.com/404]
URL = Optional.empty
Source = network
Source = security
Level = error
Level = warning
Text = Failed to load resource: the server responded with a status of 404 ()
Text = Error with Permissions-Policy header: Unrecognized feature: 'interest-cohort'.
Timestamp = 1.641199714972959E12
-------------------------------------------
Timestamp = 1.641199714979007E12
-------------------------------------------
2022-01-03 17:48:37.296 DEBUG testcase.CDPViewConsoleLogs              - 9: driver.quit()

But I found a problem. My Test Case needed the following import statement.

import org.openqa.selenium.devtools.v96.log.Log;

But Katalon Studio v8.2.1 does not bundle the required jar file to resolve this import statement.

So I had to find out which jar file is required, find out from which repository on the Internet I can get the jar. Once found, I download it and save it into the Drivers folder of my Katalon project manually.

In fact, in order to find it, I created a Gradle project using IntelliJ IDEA where I copy & pasted sample code of some tutorial, and let Gradle to resolve the required dependencies. I found that the jar of Selenium 4 depends on a lot of external jar files. Gradle told me the following dependency tree

+--- org.seleniumhq.selenium:selenium-java:4.1.1
|    +--- org.seleniumhq.selenium:selenium-api:4.1.1
|    +--- org.seleniumhq.selenium:selenium-chrome-driver:4.1.1
|    |    +--- com.google.auto.service:auto-service-annotations:1.0.1
|    |    +--- com.google.auto.service:auto-service:1.0.1
|    |    |    +--- com.google.auto.service:auto-service-annotations:1.0.1
|    |    |    +--- com.google.auto:auto-common:1.2
|    |    |    |    \--- com.google.guava:guava:31.0.1-jre
|    |    |    |         +--- com.google.guava:failureaccess:1.0.1
|    |    |    |         +--- com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|    |    |    |         +--- com.google.code.findbugs:jsr305:3.0.2
|    |    |    |         +--- org.checkerframework:checker-qual:3.12.0
|    |    |    |         +--- com.google.errorprone:error_prone_annotations:2.7.1
|    |    |    |         \--- com.google.j2objc:j2objc-annotations:1.3
|    |    |    \--- com.google.guava:guava:31.0.1-jre (*)
|    |    +--- com.google.guava:guava:31.0.1-jre (*)
|    |    +--- org.seleniumhq.selenium:selenium-api:4.1.1
|    |    +--- org.seleniumhq.selenium:selenium-chromium-driver:4.1.1
|    |    |    +--- com.google.auto.service:auto-service-annotations:1.0.1
|    |    |    +--- com.google.auto.service:auto-service:1.0.1 (*)
|    |    |    +--- com.google.guava:guava:31.0.1-jre (*)
|    |    |    +--- org.seleniumhq.selenium:selenium-json:4.1.1
|    |    |    |    \--- org.seleniumhq.selenium:selenium-api:4.1.1
|    |    |    \--- org.seleniumhq.selenium:selenium-remote-driver:4.1.1
|    |    |         +--- com.beust:jcommander:1.81
|    |    |         +--- com.google.auto.service:auto-service-annotations:1.0.1
|    |    |         +--- com.google.auto.service:auto-service:1.0.1 (*)
|    |    |         +--- com.google.guava:guava:31.0.1-jre (*)
|    |    |         +--- io.netty:netty-buffer:4.1.70.Final
|    |    |         |    \--- io.netty:netty-common:4.1.70.Final
|    |    |         +--- io.netty:netty-codec-http:4.1.70.Final
|    |    |         |    +--- io.netty:netty-common:4.1.70.Final
|    |    |         |    +--- io.netty:netty-buffer:4.1.70.Final (*)
|    |    |         |    +--- io.netty:netty-transport:4.1.70.Final
|    |    |         |    |    +--- io.netty:netty-common:4.1.70.Final
|    |    |         |    |    +--- io.netty:netty-buffer:4.1.70.Final (*)
|    |    |         |    |    \--- io.netty:netty-resolver:4.1.70.Final
|    |    |         |    |         \--- io.netty:netty-common:4.1.70.Final
|    |    |         |    +--- io.netty:netty-codec:4.1.70.Final
|    |    |         |    |    +--- io.netty:netty-common:4.1.70.Final
|    |    |         |    |    +--- io.netty:netty-buffer:4.1.70.Final (*)
|    |    |         |    |    \--- io.netty:netty-transport:4.1.70.Final (*)
|    |    |         |    \--- io.netty:netty-handler:4.1.70.Final
|    |    |         |         +--- io.netty:netty-common:4.1.70.Final
|    |    |         |         +--- io.netty:netty-resolver:4.1.70.Final (*)
|    |    |         |         +--- io.netty:netty-buffer:4.1.70.Final (*)
|    |    |         |         +--- io.netty:netty-transport:4.1.70.Final (*)
|    |    |         |         \--- io.netty:netty-codec:4.1.70.Final (*)
|    |    |         +--- io.netty:netty-common:4.1.70.Final
|    |    |         +--- io.netty:netty-transport-classes-epoll:4.1.70.Final
|    |    |         |    +--- io.netty:netty-common:4.1.70.Final
|    |    |         |    +--- io.netty:netty-buffer:4.1.70.Final (*)
|    |    |         |    +--- io.netty:netty-transport:4.1.70.Final (*)
|    |    |         |    \--- io.netty:netty-transport-native-unix-common:4.1.70.Final
|    |    |         |         +--- io.netty:netty-common:4.1.70.Final
|    |    |         |         +--- io.netty:netty-buffer:4.1.70.Final (*)
|    |    |         |         \--- io.netty:netty-transport:4.1.70.Final (*)
|    |    |         +--- io.netty:netty-transport-classes-kqueue:4.1.70.Final
|    |    |         |    +--- io.netty:netty-common:4.1.70.Final
|    |    |         |    +--- io.netty:netty-buffer:4.1.70.Final (*)
|    |    |         |    +--- io.netty:netty-transport:4.1.70.Final (*)
|    |    |         |    \--- io.netty:netty-transport-native-unix-common:4.1.70.Final (*)
|    |    |         +--- io.netty:netty-transport-native-unix-common:4.1.70.Final (*)
|    |    |         +--- io.netty:netty-transport:4.1.70.Final (*)
|    |    |         +--- io.opentelemetry:opentelemetry-api:1.9.1
|    |    |         |    \--- io.opentelemetry:opentelemetry-context:1.9.1
|    |    |         +--- io.opentelemetry:opentelemetry-context:1.9.1
|    |    |         +--- io.opentelemetry:opentelemetry-exporter-logging:1.9.1
|    |    |         |    +--- io.opentelemetry:opentelemetry-sdk:1.9.1
|    |    |         |    |    +--- io.opentelemetry:opentelemetry-api:1.9.1 (*)
|    |    |         |    |    +--- io.opentelemetry:opentelemetry-sdk-common:1.9.1
|    |    |         |    |    |    +--- io.opentelemetry:opentelemetry-semconv:1.9.1-alpha
|    |    |         |    |    |    |    \--- io.opentelemetry:opentelemetry-api:1.9.1 (*)
|    |    |         |    |    |    \--- io.opentelemetry:opentelemetry-api:1.9.1 (*)
|    |    |         |    |    \--- io.opentelemetry:opentelemetry-sdk-trace:1.9.1
|    |    |         |    |         +--- io.opentelemetry:opentelemetry-api-metrics:1.9.1-alpha
|    |    |         |    |         |    +--- io.opentelemetry:opentelemetry-api:1.9.1 (*)
|    |    |         |    |         |    \--- io.opentelemetry:opentelemetry-context:1.9.1
|    |    |         |    |         +--- io.opentelemetry:opentelemetry-semconv:1.9.1-alpha (*)
|    |    |         |    |         +--- io.opentelemetry:opentelemetry-api:1.9.1 (*)
|    |    |         |    |         \--- io.opentelemetry:opentelemetry-sdk-common:1.9.1 (*)
|    |    |         |    +--- io.opentelemetry:opentelemetry-sdk-metrics:1.9.1-alpha
|    |    |         |    |    +--- io.opentelemetry:opentelemetry-api-metrics:1.9.1-alpha (*)
|    |    |         |    |    \--- io.opentelemetry:opentelemetry-sdk-common:1.9.1 (*)
|    |    |         |    \--- io.opentelemetry:opentelemetry-sdk-logs:1.9.1-alpha
|    |    |         |         +--- io.opentelemetry:opentelemetry-api-metrics:1.9.1-alpha (*)
|    |    |         |         +--- com.fasterxml.jackson.core:jackson-databind:2.13.0
|    |    |         |         |    +--- com.fasterxml.jackson.core:jackson-annotations:2.13.0
|    |    |         |         |    |    \--- com.fasterxml.jackson:jackson-bom:2.13.0
|    |    |         |         |    |         +--- com.fasterxml.jackson.core:jackson-annotations:2.13.0 (c)
|    |    |         |         |    |         +--- com.fasterxml.jackson.core:jackson-core:2.13.0 (c)
|    |    |         |         |    |         \--- com.fasterxml.jackson.core:jackson-databind:2.13.0 (c)
|    |    |         |         |    +--- com.fasterxml.jackson.core:jackson-core:2.13.0
|    |    |         |         |    |    \--- com.fasterxml.jackson:jackson-bom:2.13.0 (*)
|    |    |         |         |    \--- com.fasterxml.jackson:jackson-bom:2.13.0 (*)
|    |    |         |         \--- io.opentelemetry:opentelemetry-sdk:1.9.1 (*)
|    |    |         +--- io.opentelemetry:opentelemetry-sdk-common:1.9.1 (*)
|    |    |         +--- io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi:1.9.1
|    |    |         |    \--- io.opentelemetry:opentelemetry-sdk:1.9.1 (*)
|    |    |         +--- io.opentelemetry:opentelemetry-sdk-extension-autoconfigure:1.9.1-alpha
|    |    |         |    +--- io.opentelemetry:opentelemetry-semconv:1.9.1-alpha (*)
|    |    |         |    +--- io.opentelemetry:opentelemetry-sdk:1.9.1 (*)
|    |    |         |    +--- io.opentelemetry:opentelemetry-sdk-metrics:1.9.1-alpha (*)
|    |    |         |    \--- io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi:1.9.1 (*)
|    |    |         +--- io.opentelemetry:opentelemetry-sdk-trace:1.9.1 (*)
|    |    |         +--- io.opentelemetry:opentelemetry-sdk:1.9.1 (*)
|    |    |         +--- io.opentelemetry:opentelemetry-semconv:1.9.1-alpha (*)
|    |    |         +--- io.ous:jtoml:2.0.0
|    |    |         +--- net.bytebuddy:byte-buddy:1.12.2
|    |    |         +--- org.apache.commons:commons-exec:1.3
|    |    |         +--- org.asynchttpclient:async-http-client:2.12.3
|    |    |         |    +--- org.asynchttpclient:async-http-client-netty-utils:2.12.3
|    |    |         |    |    +--- io.netty:netty-buffer:4.1.60.Final -> 4.1.70.Final (*)
|    |    |         |    |    +--- org.slf4j:slf4j-api:1.7.30 -> 1.7.32
|    |    |         |    |    \--- com.sun.activation:jakarta.activation:1.2.2
|    |    |         |    +--- io.netty:netty-codec-http:4.1.60.Final -> 4.1.70.Final (*)
|    |    |         |    +--- io.netty:netty-handler:4.1.60.Final -> 4.1.70.Final (*)
|    |    |         |    +--- io.netty:netty-codec-socks:4.1.60.Final
|    |    |         |    |    +--- io.netty:netty-common:4.1.60.Final -> 4.1.70.Final
|    |    |         |    |    +--- io.netty:netty-buffer:4.1.60.Final -> 4.1.70.Final (*)
|    |    |         |    |    +--- io.netty:netty-transport:4.1.60.Final -> 4.1.70.Final (*)
|    |    |         |    |    \--- io.netty:netty-codec:4.1.60.Final -> 4.1.70.Final (*)
|    |    |         |    +--- io.netty:netty-handler-proxy:4.1.60.Final
|    |    |         |    |    +--- io.netty:netty-common:4.1.60.Final -> 4.1.70.Final
|    |    |         |    |    +--- io.netty:netty-buffer:4.1.60.Final -> 4.1.70.Final (*)
|    |    |         |    |    +--- io.netty:netty-transport:4.1.60.Final -> 4.1.70.Final (*)
|    |    |         |    |    +--- io.netty:netty-codec:4.1.60.Final -> 4.1.70.Final (*)
|    |    |         |    |    +--- io.netty:netty-codec-socks:4.1.60.Final (*)
|    |    |         |    |    \--- io.netty:netty-codec-http:4.1.60.Final -> 4.1.70.Final (*)
|    |    |         |    +--- io.netty:netty-transport-native-epoll:4.1.60.Final
|    |    |         |    |    +--- io.netty:netty-common:4.1.60.Final -> 4.1.70.Final
|    |    |         |    |    +--- io.netty:netty-buffer:4.1.60.Final -> 4.1.70.Final (*)
|    |    |         |    |    +--- io.netty:netty-transport:4.1.60.Final -> 4.1.70.Final (*)
|    |    |         |    |    \--- io.netty:netty-transport-native-unix-common:4.1.60.Final -> 4.1.70.Final (*)
|    |    |         |    +--- io.netty:netty-transport-native-kqueue:4.1.60.Final
|    |    |         |    |    +--- io.netty:netty-common:4.1.60.Final -> 4.1.70.Final
|    |    |         |    |    +--- io.netty:netty-buffer:4.1.60.Final -> 4.1.70.Final (*)
|    |    |         |    |    +--- io.netty:netty-transport:4.1.60.Final -> 4.1.70.Final (*)
|    |    |         |    |    \--- io.netty:netty-transport-native-unix-common:4.1.60.Final -> 4.1.70.Final (*)
|    |    |         |    +--- org.reactivestreams:reactive-streams:1.0.3
|    |    |         |    +--- com.typesafe.netty:netty-reactive-streams:2.0.4
|    |    |         |    |    +--- io.netty:netty-handler:4.1.43.Final -> 4.1.70.Final (*)
|    |    |         |    |    \--- org.reactivestreams:reactive-streams:1.0.3
|    |    |         |    +--- org.slf4j:slf4j-api:1.7.30 -> 1.7.32
|    |    |         |    \--- com.sun.activation:jakarta.activation:1.2.2
|    |    |         +--- org.seleniumhq.selenium:selenium-api:4.1.1
|    |    |         +--- org.seleniumhq.selenium:selenium-http:4.1.1
|    |    |         |    +--- com.google.guava:guava:31.0.1-jre (*)
|    |    |         |    +--- net.jodah:failsafe:2.4.4
|    |    |         |    +--- org.seleniumhq.selenium:selenium-api:4.1.1
|    |    |         |    \--- org.seleniumhq.selenium:selenium-json:4.1.1 (*)
|    |    |         \--- org.seleniumhq.selenium:selenium-json:4.1.1 (*)
|    |    +--- org.seleniumhq.selenium:selenium-json:4.1.1 (*)
|    |    \--- org.seleniumhq.selenium:selenium-remote-driver:4.1.1 (*)
|    +--- org.seleniumhq.selenium:selenium-devtools-v85:4.1.1
|    |    +--- com.google.auto.service:auto-service-annotations:1.0.1
|    |    +--- com.google.auto.service:auto-service:1.0.1 (*)
|    |    +--- com.google.guava:guava:31.0.1-jre (*)
|    |    +--- org.seleniumhq.selenium:selenium-api:4.1.1
|    |    +--- org.seleniumhq.selenium:selenium-json:4.1.1 (*)
|    |    \--- org.seleniumhq.selenium:selenium-remote-driver:4.1.1 (*)
|    +--- org.seleniumhq.selenium:selenium-devtools-v94:4.1.1
|    |    +--- com.google.auto.service:auto-service-annotations:1.0.1
|    |    +--- com.google.auto.service:auto-service:1.0.1 (*)
|    |    +--- com.google.guava:guava:31.0.1-jre (*)
|    |    +--- org.seleniumhq.selenium:selenium-api:4.1.1
|    |    +--- org.seleniumhq.selenium:selenium-json:4.1.1 (*)
|    |    \--- org.seleniumhq.selenium:selenium-remote-driver:4.1.1 (*)
|    +--- org.seleniumhq.selenium:selenium-devtools-v95:4.1.1
|    |    +--- com.google.auto.service:auto-service-annotations:1.0.1
|    |    +--- com.google.auto.service:auto-service:1.0.1 (*)
|    |    +--- com.google.guava:guava:31.0.1-jre (*)
|    |    +--- org.seleniumhq.selenium:selenium-api:4.1.1
|    |    +--- org.seleniumhq.selenium:selenium-json:4.1.1 (*)
|    |    \--- org.seleniumhq.selenium:selenium-remote-driver:4.1.1 (*)
|    +--- org.seleniumhq.selenium:selenium-devtools-v96:4.1.1
|    |    +--- com.google.auto.service:auto-service-annotations:1.0.1
|    |    +--- com.google.auto.service:auto-service:1.0.1 (*)
|    |    +--- com.google.guava:guava:31.0.1-jre (*)
|    |    +--- org.seleniumhq.selenium:selenium-api:4.1.1
|    |    +--- org.seleniumhq.selenium:selenium-json:4.1.1 (*)
|    |    \--- org.seleniumhq.selenium:selenium-remote-driver:4.1.1 (*)
|    +--- org.seleniumhq.selenium:selenium-edge-driver:4.1.1
|    |    +--- com.google.auto.service:auto-service-annotations:1.0.1
|    |    +--- com.google.auto.service:auto-service:1.0.1 (*)
|    |    +--- com.google.guava:guava:31.0.1-jre (*)
|    |    +--- org.seleniumhq.selenium:selenium-api:4.1.1
|    |    +--- org.seleniumhq.selenium:selenium-chromium-driver:4.1.1 (*)
|    |    \--- org.seleniumhq.selenium:selenium-remote-driver:4.1.1 (*)
|    +--- org.seleniumhq.selenium:selenium-firefox-driver:4.1.1
|    |    +--- com.google.auto.service:auto-service-annotations:1.0.1
|    |    +--- com.google.auto.service:auto-service:1.0.1 (*)
|    |    +--- com.google.guava:guava:31.0.1-jre (*)
|    |    +--- org.seleniumhq.selenium:selenium-devtools-v85:4.1.1 (*)
|    |    +--- org.seleniumhq.selenium:selenium-json:4.1.1 (*)
|    |    \--- org.seleniumhq.selenium:selenium-remote-driver:4.1.1 (*)
|    +--- org.seleniumhq.selenium:selenium-firefox-xpi-driver:4.1.1
|    |    +--- com.google.auto.service:auto-service-annotations:1.0.1
|    |    +--- com.google.auto.service:auto-service:1.0.1 (*)
|    |    +--- com.google.guava:guava:31.0.1-jre (*)
|    |    +--- org.seleniumhq.selenium:selenium-api:4.1.1
|    |    +--- org.seleniumhq.selenium:selenium-firefox-driver:4.1.1 (*)
|    |    \--- org.seleniumhq.selenium:selenium-remote-driver:4.1.1 (*)
|    +--- org.seleniumhq.selenium:selenium-ie-driver:4.1.1
|    |    +--- com.google.auto.service:auto-service-annotations:1.0.1
|    |    +--- com.google.auto.service:auto-service:1.0.1 (*)
|    |    +--- org.seleniumhq.selenium:selenium-api:4.1.1
|    |    \--- org.seleniumhq.selenium:selenium-remote-driver:4.1.1 (*)
|    +--- org.seleniumhq.selenium:selenium-opera-driver:4.1.1
|    |    +--- com.google.auto.service:auto-service-annotations:1.0.1
|    |    +--- com.google.auto.service:auto-service:1.0.1 (*)
|    |    +--- org.seleniumhq.selenium:selenium-api:4.1.1
|    |    \--- org.seleniumhq.selenium:selenium-remote-driver:4.1.1 (*)
|    +--- org.seleniumhq.selenium:selenium-remote-driver:4.1.1 (*)
|    +--- org.seleniumhq.selenium:selenium-safari-driver:4.1.1
|    |    +--- com.google.auto.service:auto-service-annotations:1.0.1
|    |    +--- com.google.auto.service:auto-service:1.0.1 (*)
|    |    +--- com.google.guava:guava:31.0.1-jre (*)
|    |    +--- org.seleniumhq.selenium:selenium-api:4.1.1
|    |    \--- org.seleniumhq.selenium:selenium-remote-driver:4.1.1 (*)
|    \--- org.seleniumhq.selenium:selenium-support:4.1.1
|         +--- com.google.auto.service:auto-service-annotations:1.0.1
|         +--- com.google.auto.service:auto-service:1.0.1 (*)
|         +--- com.google.guava:guava:31.0.1-jre (*)
|         +--- org.seleniumhq.selenium:selenium-api:4.1.1
|         +--- org.seleniumhq.selenium:selenium-json:4.1.1 (*)
|         \--- org.seleniumhq.selenium:selenium-remote-driver:4.1.1 (*)

This means that a user who want to utilise the goodness of Selenium 4 (for example, CDP support) have to resolve external dependencies them selves as I did, because Katalon Studio does not help us resolving external dependencies as Maven/Gradle does.

Especially you should note the name of jar file:

org.seleniumhq.selenium:selenium-devtools-v96:4.1.1

Here you find v96. This represents the version of Chrome browser. When Chrome browser is upgraded to a new version sometime near future, a new jar org.seleniumhq.selenium:selenium-devtools-v97 will be published in the Maven Central repository. Then users who want to utilise CDP feature through Seleium 4 in Katalon Studio >8.2.1 have to resolve the dependency themselves manually.

This reminds me that Katalon Studio provides Tools > Upgrade WebDriver > Chrome menu in the tools bar. I suppose we need Tools > Upgrade Selenium 4 DevTools jar as well.

By the way, I found that it is harmless to switch the jar file of Selenium bundled in Katalon Studio from v3 to v4. Selenium v4 is well backward compatible. My old projects safely ran in KS v8.2.1-alpha. Note that DesiredCapability class is deprecated in Selenium 4; no longer to be used by Katalon users.

4 Likes

I noticed that this blog by Katalon carefully ignored the CDP support of Selenium 4.

For me, Selenium 4 without CDP is not adorable.

1 Like

I hope Katalon Studio offers me a way to retrieve the dependency tree of all jar files which are bundled in the Katalon’s distributable. I hope KS is capable to show the above dependency tree of the org.seleniumhq.selenium:selenium-java:4.1.1 within the KS GUI. If it is provided I can configure build.gradle to additionally download the org.seleniumhq.selenium:selenium-devtools-v96:4.1.1, which is missing in the distributable, into the Drivers directory. If this feature is provided, I would not have to create another gradle project in IntelliJ IDEA to find out what I need to know.


In Selenium 4, DesiredCapabilities class is deprecated.

I saw a code new ChromeDriver(Capabilities) is struck out in the editor of KS v8.2.1alpha. I checked the javadoc of ChromeDriver and found the signature is deprecated.

On the other hand, Katalon Studio v8.2.0 GUI is designed with DesiredCapabilities extensively.
https://docs.katalon.com/katalon-studio/docs/introduction-to-desired-capabilities.html
Therefore, if Selenium 4 is aimed, Katalon Studio have to modify its GUI to meet the deprecation of DesiredCapabilities. I suppose it would involve a lot of work.

Also, the projects developed by users need to be migrated; migrate DesiredCapabilities configured by users to ChromeOptions or FirefoxOptions. — well, it is possible? I am afraid not.

A lot of confusions may arise if KS moves toward Selenium 4.

2 Likes

Hi @kazurayam

I feel grateful for all the feedback and insights provided above. They are exactly what we’re looking forward to when publishing this alpha version. Thank you very much and Happy Lunar New Year!

Regards,

Jass

Just noting that we’ve posted a sample Studio project that exercises some of the Selenium 4 features, including:

  • Relative locators
  • Shadow DOM access
  • Tab management
  • Chrome DevTools Protocol (CDP) examples:
    • Network interception
    • Console log capture
    • Performance metric capture

You can find the GitHub repo here:

@kazurayam you’ll note that the Gradle file in that project includes pulling in the latest DevTools JAR compatible with Selenium 4.1. (If you move to the 9.0 alpha release, it is built on Selenium 4.3.)

2 Likes

I read it.

To me, this example suggests that Katalon Team implicitly demands users to edit the build.gradle file to specify the required version of DevTool jar and execute $ gradle katalonCopyDependencies to perform pulling the latest jar.

A problem for users arises here. Usually the users set-up Chrome and other browsers to upgrade automatically when a new version is released. So it is quite likely that, when the browsers are upgraded silently, their Selenium4 based Katalon projects suddently stops working because the version of browser and DevTools-jar mismatches. They might post questions to the forum.katalon.com asking why their tests suddenly stop working. Their problems will repeat for years as long as the versions of browsers continue updated.

How are you, Katalon Team, going to manage this difficulty?

I think that one of the value of Katalon Studio for users is that users are not responsible at all for managing the vesions of dependent jars as long as they use Katalon Studio’s built-in functionalities. Are you going to abandon this value ---- built-in jars are consistently managed by the product – as of Studio 9?

Are you going to ask users to be responsible for the version consistency of DevTools jar and browser? It is not enough if you say “look at this build.gradle example”. Usual Katalon users do not understand Gradle at all. They do not have Gradle installed. Does the Studio 9.x requires users to install Gradle for themselves? Then Katalon Studio will no longer be “All-In-One Test Automation Platform”.

@kazurayam I completely agree with you regarding the value of Studio for managing versions and other complexity for users. We’re absolutely not planning to abandon that. The Gradle file in the example was just for this alpha period and was not at all meant to suggest that we would require that in the GA release. We are still working on a solution for managing CDP changes along with the browser driver changes we’ve historically managed. Thank you for your continued feedback.

1 Like

I would like to get devtools working with Katalon Studio groovey scripts but it always throws an error. I Imported org.openqa.selenium.devtools but still when I use .getDevTools() it cannot resolve it. And I put the “selenium-devtools-v106-4.5.3.jar” copied into my Drivers folder.

Do you know what I am doing wrong? Or any hint what I could do?

The main purpose is to use Katalon Studio Test without aditional tool for handling Chrome basic Authentication popup.

This feature requires Selenium4. But Katalon Studio does not yet work with Selenium 4. THe “selenium-devtools-v106-4.5.3.jar” will never be used by Katalon.

If you seriously want to use Chrome DevTools Protocol (CDP), then I would recommend to look at other testing frameworks that supports CDP already, such as plain Selenium4 driven by Maven/Gradle or Playwright instead of Katalon Studio.

You want to use Chrome DevTools Protocol in Katalon Studio. But Katalon does not yet support Selenium4, so that the selenium-devtools-v106-4.5.4.jar does not work in Katalon.

An alternative way is available. It would be worth mensioning.

Use GitHub - kklisura/chrome-devtools-java-client: Chrome DevTools java client.

I have ever created a project where I used this jar in Katalon Studio v8.3.0. I used the CDP Networking feature. It worked OK. However I do not know if the kklisura’s project meets your requirement. The library might be a partial implementation of CDP functionality. I haven’t checked it how this lib is versatile.

Here is my sample Test Case code that uses the kklisura’s library and use CDP

@Steve.B

You wrote:

I read the following article:

This article told me that you want to set extra headers into HTTP Request.

I checked the com.github.kklisura.cdt project, and found the following sample code:

This code demostrates that it supports setting custom headers into HTTP Request.

Therefore, I guess, you can handle Chrome Basic Authentication popup using this library in any of the version Katalon Studio. You wouldn’t need Selenium4 adn selenium-devtools-v106-4.5.4.jar.


However, I have a doubt about @Steve.B’s idea.

Is it possible to let Katalon Studio communicate with a single instance of Chrome browser through 2 TCP sessions? — one for Selenum WebDriver to talk to Chrome on the WebDriver protocol, another for a Java Client to talk to Chrome on the Chrome DevTools Protocol?

I think it is very difficult. I suppose that nobody has ever got such idea. Therefore, the kklisura’s library might be useless for you.

I don’t know if Selenium4 + CDP support make it possible for Katalon Test Case to comminicate with Chrome browser through 2 TCP sessions and retain a single conversation between Katalon and Chrome. … Highly unlikely, I think.


It might be straight forward and much easier if you do all of your testing job using Playwright through a single TCP session with a browser through Chrome DevTools Protocol.

@kazurayam thank you for all your response. I will have a look at it soon.

The main problem is that on some internal websites, it is required to login. And in some cases Chrome or firefox uses Basic Authentication and a popup which cannot be handled by the DOM needs to be filled out. I am aware there is a Solution with AutoIT, but I am hightly against this option and there must be a better way to handle Basic Authentication with Katalon Studio.

I am negative about it.

IMHO, Basic Authentication is an old-school identity-verification process which is rarely used for productional use, isn’t a subject for you worth struggling with.

If your Application Under Test is an internal website, then you should be able to change its design. You should have a chance to talk to the development team of the website. I would suggest to you to advise them; they should not use Basic Authentication; they should rather use <HTML> Form-based Authentication. I believe, it is not a big deal for the development team to implement Form-based Authentication at all. If the website uses Form-based Authentication, then your life as a web ui tester would be far easier, more productive.