Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gs-pbandi opened this issue Jul 19, 2023 · 2 comments

Comments

@gs-pbandi
Copy link

gs-pbandi commented Jul 19, 2023

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.

@vpokotilov
Copy link
Contributor

@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.

@srntqn
Copy link
Member

srntqn commented Oct 2, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants