Page 1 of 1

Ranorex Test Unable to Run on SeleniumGrid 4.

Posted: Tue Dec 14, 2021 8:58 am
by apae
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:

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();
}
// Ranorex Studio Actions ...

Thanks!
Angelo

Re: Ranorex Test Unable to Run on SeleniumGrid 4.

Posted: Tue Dec 14, 2021 3:27 pm
by odklizec
Hi,

Could you please try to create an endpoint directly in Ranorex Studio and run some basic tests using Ranorex recordings (i.e. not using custom code). Does it work?

Re: Ranorex Test Unable to Run on SeleniumGrid 4.

Posted: Wed Dec 15, 2021 8:40 am
by apae
Hi,

No it does not work, if I create an endpoint directly or use usercode with Ranorex recordings for SeleniumGrid4.
If I use the Selenium remote driver code the session starts but no interactions with Ranorex recordings.

Re: Ranorex Test Unable to Run on SeleniumGrid 4.

Posted: Wed Dec 15, 2021 10:55 am
by odklizec
Hi,

I just noticed Selenium Grid 4 has been released only about a month ago. So it seems it’s not supported yet and you will have to wait for the official Ranorex release, which adds support for SG4.

Re: Ranorex Test Unable to Run on SeleniumGrid 4.

Posted: Wed Dec 15, 2021 1:25 pm
by apae
It is strange I emailed RX Support 2 week's ago, they told me Ranorex supports Selenium Grid 4. And didn't get great support for this issue. I think you are right.

Re: Ranorex Test Unable to Run on SeleniumGrid 4.

Posted: Wed Dec 15, 2021 2:40 pm
by odklizec
I’m sorry to hear about your bad experience :| Let’s hope they will support SG4 soon? 😉