Type your question here. Then choose a suita Issue 1 : We prepared a code and imported required jar files and facing the issue , we are not able to see android and some execution options and even not able to execute , even if we click on execute on chrome browser nothing happens
Noted an issue even after importing the required jar files getDevTools() method is not recognized by katalon 8.3.5 version . Need guidance for this issue
Issue2:
Since getDevTools() method is not recognized we tried to use different way for devtools implementation
SmartWaitWebDriver smartWaitWebDriver = **new** SmartWaitWebDriver(driver)
println("inside loop of network")
smartWaitWebDriver.startChromeWithNetworkCapture()
=============
**package** com.clario.webui
**import** org.openqa.selenium.chrome.ChromeDriver
**import** org.openqa.selenium.chrome.ChromeOptions
**import** org.openqa.selenium.devtools.DevTools
**import** org.openqa.selenium.devtools.v125.network.Network
**import** com.kms.katalon.core.annotation.Keyword
**import** com.kms.katalon.core.webui.driver.DriverFactory
**import** java.util.Optional
**import** org.openqa.selenium.By
**import** org.openqa.selenium.WebDriver;
**import** org.openqa.selenium.WebElement
**import** java.util.List
**import** java.util.Set
**import** java.util.Optional
**public** **void** startChromeWithNetworkCapture() {
// Create a DevTools instance
DevTools devTools = **new** DevTools(**this** );
// Start the DevTools session
devTools.createSession();
// Enable network monitoring
devTools.send(Network.*enable*(Optional.*empty*(), Optional.*empty*(), Optional.*empty*()));
// Add a listener for network requests
devTools.addListener(Network.*requestWillBeSent*()) { params ->
System.***out*** .println("Request URL: " + params.getRequest().getUrl())
System.***out*** .println("Request Method: " + params.getRequest().getMethod())
System.***out*** .println("Request Headers: " + params.getRequest().getHeaders())
System.***out*** .println("Request Post Data: " + params.getRequest().~~getPostData~~())
System.***out*** .println("Request Timestamp: " + params.getTimestamp())
}
}
Error we received:
024-06-06 16:21:12.951 ERROR c.k.katalon.core.main.TestCaseExecutor - ❌ Test Cases/MicroPortal/Dispense/4 FAILED.
Reason:
groovy.lang.GroovyRuntimeException: Could not find matching constructor for: com.clario.webui.SmartWaitWebDriver(com.kms.katalon.core.webui.driver.SmartWaitWebDriver)
Issue 3:
So the previous way was not supporting we tried a another way using proxy but we are getting facing below issue (SSL certificate issue, site is displaying as not secured one)
ERROR:
2024-06-06 15:51:31.074 ERROR o.l.proxy.impl.ClientToProxyConnection - (NEGOTIATING_CONNECT) [id: 0xb5271f8a, L:0.0.0.0/0.0.0.0:60196 ! R:/fe80:0:0:0:910e:5e67:8e0d:3b2%4:60214]: Caught an exception on ClientToProxyConnection
io.netty.handler.codec.DecoderException: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
Code we prepared:
// Start BrowserMob Proxy
BrowserMobProxy proxy = **new** BrowserMobProxyServer()
proxy.start(0)
println("Proxy started on port: " + proxy.getPort())
// Get the Selenium proxy object
Proxy seleniumProxy = ClientUtil.*createSeleniumProxy*(proxy)
// Configure Chrome options
ChromeOptions options = **new** ChromeOptions()
options.addArguments("–ignore-certificate-errors")
options.addArguments("–allow-running-insecure-content")
options.addArguments("–allow-insecure-localhost")
options.setProxy(seleniumProxy)
// Start the Chrome browser with configured options
WebDriver driver = **null**
**try** {
driver = **new** ChromeDriver(options)
DriverFactory.*changeWebDriver*(driver) // Set the WebDriver instance in Katalon
println("Browser launched successfully")
} **catch** (Exception e) {
println("Failed to launch browser: " + e.getMessage())
**throw** e
}
// Enable more detailed HAR capture, if desired (see CaptureType for the complete list)
proxy.enableHarCaptureTypes(CaptureType.***REQUEST_CONTENT*** , CaptureType.***RESPONSE_CONTENT*** )
// Create a new HAR with the label "network_traffic"
proxy.newHar('network_traffic')
// Perform login actions
**try** {
WebUI.*navigateToUrl*(login.getValue('url', userrow))