Ranorex Test Unable to Run on SeleniumGrid 4.

Ranorex Studio, Spy, Recorder, and Driver.
apae
Posts: 3
Joined: Thu Dec 09, 2021 9:05 am

Ranorex Test Unable to Run on SeleniumGrid 4.

Post by apae » 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:

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

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7426
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Ranorex Test Unable to Run on SeleniumGrid 4.

Post by odklizec » Tue Dec 14, 2021 3:27 pm

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?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

apae
Posts: 3
Joined: Thu Dec 09, 2021 9:05 am

Re: Ranorex Test Unable to Run on SeleniumGrid 4.

Post by apae » Wed Dec 15, 2021 8:40 am

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.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7426
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Ranorex Test Unable to Run on SeleniumGrid 4.

Post by odklizec » Wed Dec 15, 2021 10:55 am

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.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

apae
Posts: 3
Joined: Thu Dec 09, 2021 9:05 am

Re: Ranorex Test Unable to Run on SeleniumGrid 4.

Post by apae » Wed Dec 15, 2021 1:25 pm

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.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7426
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Ranorex Test Unable to Run on SeleniumGrid 4.

Post by odklizec » Wed Dec 15, 2021 2:40 pm

I’m sorry to hear about your bad experience :| Let’s hope they will support SG4 soon? 😉
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration