Closed fabytta closed 1 month ago
@fabytta, 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.
After troubleshooting the issue, please add the R-awaiting answer
label.
Thank you!
hi @fabytta ,
can you set the following capability to enable BiDi protocol and try
options.setCapability("webSocketUrl", true);
Thanks, Sri Harsha
And also augment the driver. Let me share an example. https://github.com/SeleniumHQ/selenium/blob/trunk/java/test/org/openqa/selenium/grid/router/RemoteWebDriverBiDiTest.java#L99
Hello @harsha509, Thanks for the suggestion, but it still didn't work with the proposed option :(
Hello @pujagani, when I tried augmenting without options.setCapability("webSocketUrl", true); --> I got the same error : java.lang.IllegalArgumentException: WebDriver instance must support BiDi protocol when I tried augmenting with options.setCapability("webSocketUrl", true); --> I got the new error : org.openqa.selenium.remote.http.ConnectionFailedException: JdkWebSocket initial request execution error
"when I tried augmenting with options.setCapability("webSocketUrl", true); --> I got the new error : org.openqa.selenium.remote.http.ConnectionFailedException: JdkWebSocket initial request execution error
" - Can you help share a script/setup that can help reproduce this? I have not faced this error earlier, and I can help triage it further if I can reproduce it. Also, please ensure the Grid version on the device farm supports BiDi and allows websocket connection.
Hey @pujagani, I understand that you need full script t reproduce, I tried to clean it a little to be able to share
public class AWSTests {
WebDriver driver;
@Before
public void setUp() throws MalformedURLException {
String myProjectARN = "arnProjectFromAWSDeviceFarm";
DeviceFarmClient client = DeviceFarmClient.builder().region(Region.US_WEST_2).build();
//I use AWS sdk here to build the url and I pass keys as environement variables of my run
CreateTestGridUrlRequest request = CreateTestGridUrlRequest.builder()
.expiresInSeconds(300)
.projectArn(myProjectARN)
.build();
CreateTestGridUrlResponse response = client.createTestGridUrl(request);
URL testGridUrl = new URL(response.url());
// You can now pass this URL into RemoteWebDriver.
ChromeOptions options = new ChromeOptions();
options.setPlatformName("windows");
Proxy proxy = new Proxy();
proxy.setHttpProxy("myproxy:80");
proxy.setSslProxy("myProxy:80");
options.setCapability("proxy", proxy);
options.addArguments(
"--proxy-server=my_proxy:80");
options.setCapability("webSocketUrl", true);
DesiredCapabilities desired_capabilities = new DesiredCapabilities();
desired_capabilities.setCapability(ChromeOptions.CAPABILITY,options);
driver = new RemoteWebDriver(testGridUrl,desired_capabilities );
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(30));
driver.manage().window().maximize();
driver = new Augmenter().augment(driver);
}
@Test
public void canContinueWithAuthCredentials() {
try (Network network = new Network(driver)) {
network.addIntercept(new AddInterceptParameters(InterceptPhase.AUTH_REQUIRED));
network.onAuthRequired(
responseDetails ->
network.continueWithAuth(
responseDetails.getRequest().getRequestId(),
new UsernameAndPassword("admin", "admin")));
driver.get("https://the-internet.herokuapp.com/basic_auth");
String successMessage = "Congratulations! You must have the proper credentials.";
WebElement elementMessage = driver.findElement(By.tagName("p"));
Assert.assertEquals(successMessage, elementMessage.getText());
}
}
@After
public void tearDown() {
// make sure to close your WebDriver:
driver.quit();
}
}
To be able to reproduce you may need an access to the device farm : https://docs.aws.amazon.com/devicefarm/latest/testgrid/getting-started-migration.html
@pujagani , regarding your comment : "Also, please ensure the Grid version on the device farm supports BiDi and allows websocket connection." is there and documentation on how to make the grid support BIDI and allows websocket so that I share it with the support of the aws grid ?
Which version of Grid are you using? Nothing special needs to be done to enable it. Actually, in such cases where proxy is used, I have often seen that proxy does not allow websocket connections. So there is nothing Selenium specific, but it is more on how the proxy or even firewall is configured.
This issue was closed because we did not receive any additional information after 14 days.
This issue has been automatically locked since there has not been any recent activity since it was closed. Please open a new issue for related bugs.
What happened?
I'm running my tests on the AWS Device Farm grid using RemotWebDriver, the browsers there are up to date, but when I use the bedi features I get java.lang.IllegalArgumentException: WebDriver instance must support BiDi protocol my code :
The error I'm getting : java.lang.IllegalArgumentException: WebDriver instance must support BiDi protocol
What can I do to make the webdriver instance support bidi, is there a specifci update or request to make to AWS device farm team ?
What browsers and operating systems are you seeing the problem on?
issue reproducible with Firefox and Chrome on Windows