Closed sumanguduru closed 2 years ago
@sumanguduru, thank you for creating this issue. We will troubleshoot it as soon as we can.
Triage this issue by using labels.
If information is missing, add a helpful comment and then I-issue-template
label.
If the issue is a question, add the I-question
label.
If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted
label.
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, W3C),
add the applicable G-*
label, and it will provide the correct link and auto-close the
issue.
After troubleshooting the issue, please add the R-awaiting answer
label.
Thank you!
And i tried with RemoteWebDriver.builder() and getting different Driver info: driver.version: unknown****
URL browserStackHubURL = new URL("https://
InetSocketAddress inetSocketAddress = new InetSocketAddress(Constants.BS_PROXY_HOST, Constants.BS_PROXY_PORT);
ClientConfig config = ClientConfig.defaultConfig()
.readTimeout(Duration.ofSeconds(60))
.baseUrl(browserStackHubURL)
.proxy(new Proxy(HTTP, inetSocketAddress));
WebDriver driver = RemoteWebDriver.builder()
.oneOf(capabilities)
.config(config)
.build();
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: java.net.ConnectException: connection timed out: hub.browserstack.com/207.254.8.8:443 Build info: version: '4.1.1', revision: 'e8fcc2cecf' System info: host: 'myhost', ip: 'myip', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-1160.49.1.el7.x86_64', java.version: '11.0.1' Driver info: driver.version: unknown at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:84) at org.openqa.selenium.remote.RemoteWebDriverBuilder.getRemoteDriver(RemoteWebDriverBuilder.java:387) at org.openqa.selenium.remote.RemoteWebDriverBuilder.build(RemoteWebDriverBuilder.java:360) at com.mastercard.commercial.track.testrunners.RunCucumber.beforeClass(RunCucumber.java:86) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56) at org.junit.internal.runners.statements.RunBefores.invokeMethod(RunBefores.java:33) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.ParentRunner.run(ParentRunner.java:413) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:410) at org.apache.maven.surefire.junitcore.pc.InvokerStrategy.schedule(InvokerStrategy.java:54) at org.apache.maven.surefire.junitcore.pc.Scheduler.schedule(Scheduler.java:367) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.ParentRunner.run(ParentRunner.java:413) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:410) at org.apache.maven.surefire.junitcore.pc.InvokerStrategy.schedule(InvokerStrategy.java:54) at org.apache.maven.surefire.junitcore.pc.Scheduler.schedule(Scheduler.java:367) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.ParentRunner.run(ParentRunner.java:413) at org.apache.maven.surefire.junitcore.pc.ParallelComputerBuilder$PC$1.run(ParallelComputerBuilder.java:590) at org.apache.maven.surefire.junitcore.JUnitCore.run(JUnitCore.java:55) at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.createRequestAndRun(JUnitCoreWrapper.java:137) at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.executeLazy(JUnitCoreWrapper.java:119) at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:87) at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:75) at org.apache.maven.surefire.junitcore.JUnitCoreProvider.invoke(JUnitCoreProvider.java:158) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345) at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)
However if i set system proxies before the above code snippets its connecting to remoteWebdriver without any issues, But i cant use useSystemProxies because it's blocking some of the API calls i'm making inside the test suite.
System.setProperty("java.net.useSystemProxies", "true");
System.setProperty("http.proxyHost", Constants.BS_PROXY_HOST);
System.setProperty("http.proxyPort", String.valueOf(Constants.BS_PROXY_PORT));
I think you want to set the proxy in the options class not in the service class?
The service class affects how wire calls are made, the options class affects how assets are loaded into the browser. Which one are you interested in?
@titusfortner , I am not sure about exact difference between options and service class, currently im not able to connect to remote webdriver through outbound proxy, i was using selenium3.1.4 and was able to connect to remotewebdriver through HttpCommandExecutor by passing HTTPClient.Factory with proxy host and port, and now im trying to update selenium to 4.12 and above code snippet i am using to connect to remote webdriver. its not connecting
The below code snippet is from NettyClient.java (selenium)
.setNettyTimer(TIMER)
.setRequestTimeout(toClampedInt(config.readTimeout().toMillis()))
.setConnectTimeout(toClampedInt(config.connectionTimeout().toMillis()))
.setReadTimeout(toClampedInt(config.readTimeout().toMillis()));
.setReadTimeout(toClampedInt(config.readTimeout().toMillis()))
.setUseProxyProperties(true)
.setUseProxySelector(true);
**I think its missing proxy server details which user is passing through Client config. but im not sure though**
` .setProxyServer(new ProxyServer.Builder("config.proxy().address()",11).build())`
This is a duplicate of #10231
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
What happened?
Selenium4 unable to connect to RemoteWebDriver with proxy
How can we reproduce the issue?
Relevant log output
Operating System
macos
Selenium version
4.1.1
What are the browser(s) and version(s) where you see this issue?
chrome
What are the browser driver(s) and version(s) where you see this issue?
any version
Are you using Selenium Grid?
No response