Ranorex Test Unable to Run on SeleniumGrid 4.
Posted: Tue Dec 14, 2021 8:58 am
Hi folks,
I have a simple Ranorex (Version: 10.1.2) test and it works with SeleniumGrid 3, local and on Docker.
But when I'm using SeleniumGrid 4 it does not start the browser session, I got following error:
The HTTP request to the remote WebDriver server for URL http://localhost:4444/session timed out after 60 seconds.
The operation has timed out
The usercode to create the endpoint and start the browser is:
// Ranorex Studio Actions ...
Thanks!
Angelo
I have a simple Ranorex (Version: 10.1.2) test and it works with SeleniumGrid 3, local and on Docker.
But when I'm using SeleniumGrid 4 it does not start the browser session, I got following error:
The HTTP request to the remote WebDriver server for URL http://localhost:4444/session timed out after 60 seconds.
The operation has timed out
The usercode to create the endpoint and start the browser is:
Code: Select all
public void StartBrowserEndpoint()
{
// Create endpoint management factory
var fac = new RemoteEndpointFactory();
// Create configuration for endpoint
// var endpointConfig = WebDriverConfiguration.FromJson("{\"platformName\": \"Linux\", \"browserName\": \"firefox\"}"); // for Docker
// var endpointConfig = WebDriverConfiguration.FromJson("{\"browserName\": \"chrome\"}");
var endpointConfig = WebDriverConfiguration.FromJson("{\"browserName\": \"firefox\"}");
endpointConfig.Name = "Endpoint Browser";
endpointConfig.Description = "Endpoint Configuration";
// Create endpoint, for SeleniumGrid 4 you can even use "http://localhost:4444", do not create the endpoint with Ranorex Studio!
var endpoint = fac.CreateTransientWebDriverEndpoint(new WebDriverEndpointInfo("SeleniumGrid", "http://localhost:4444/wd/hub"));
endpoint.ActivateConfiguration(endpointConfig);
endpoint.ConnectAsync()
.ContinueWith(_ => endpoint.MakeCurrentHostAsync())
.Wait();
var webDriverEndpoint = Host.Current.TryGetAsWebDriverEndpoint();
if(webDriverEndpoint == null) { throw new InvalidOperationException("This test is not running on a web driver host"); }
string url = "https://www.google.com";
Report.Log(ReportLevel.Info, "Endpoint", String.Format("{0}", webDriverEndpoint.ToString()));
//var driver = webDriverEndpoint.StartBrowser("chrome", url);
var driver = webDriverEndpoint.StartBrowser("firefox", url);
// driver.Navigate().GoToUrl(url);
// driver.Maximize();
driver.Manage().Window.Maximize();
}
Thanks!
Angelo