wrike/callisto

Web socket connection exception when Augmenter() is used to enhance Web driver

gs-pbandi opened this issue · 2 comments

Hi,

I am using Augmenter() in my code to enhance Webdriver to capture Network logs using chrome devtools. However, i am observing exception when I am trying to do this.

INFO: Found exact CDP implementation for version 114
Jul 19, 2023 6:13:44 AM org.openqa.selenium.devtools.CdpEndpointFinder getCdpEndPoint
WARNING: Unable to connect to determine websocket url: java.net.ConnectException: Connection refused: localhost/127.0.0.1:41403
2023-07-19 06:13:44,402 ERROR [main] (CaptureNetworkRequests.java:190) - Exception occurred - org.openqa.selenium.devtools.DevToolsException: Unable to create DevTools connection
Build info: version: '4.1.3', revision: '7b1ebf28ef'
System info: host: 'ip-10-0-131-191.ec2.internal', ip: '10.0.131.191', os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.43-17.39.amzn1.x86_64', java.version: '1.8.0_342'
Driver info: DevTools Connection


this is my code snippet
try {
if (ObjectUtils.isEmpty(devTools)) {
if (fwConfig.getBrowser().equals(Browser.CHROME.getName())) {
webDriver = new Augmenter().augment(webDriver);
devTools = ((HasDevTools) webDriver).getDevTools();
devTools.createSession();
}
}
} catch (Exception ex) {
Log.error("Exception occurred - " + ex);
}


When googled I have found this solution(https://github.com/SeleniumHQ/docker-selenium#grid-url-and-session-timeout), but since we don't have hub and nodes. I am not sure whether this solution helps me. If for any reason if I should add such an environment variable, please let me know on how to do it as well.

I am using
selenium-java = 4.1.3
Java = 8
selenium-devtools-v114

P.S: I already added this argument in chromeOptions(options.addArguments("--remote-allow-origins=*")).

Please help me to solve this issue.

Thanks in advance.

@gs-pbandi hi!
Callisto does not currently provide access to devtools.
It probably shouldn't be hard to add.
I'll look a little later on how this can be done. It will be useful for us too - there is an idea to start using it in our tests.

@gs-pbandi hi! We're going to postpone our work on this feature, we'll keep you posted about any changes in our priorities.