Remote script execution using Selenium Grid

I am trying to setup remote script execution using selenium grid whis is sort of sucess and failure at the same time as well.

I setup selenium hub and node at same remote machine. I then added hub server IP address in Katalon by following this guide https://docs.katalon.com/katalon-studio/manage-projects/project-settings/desired-capabilities/selenium-grid---execution-on-remote-machines-with-katalon-studio

In my start browser script, I initialized chrome driver using

WebDriver remoteDriver = new RemoteWebDriver(new URL("<URL of hub>"), capability)

DriverFactory.changeWebDriver(remoteDriver)	

Now if I run the start browser script, it successfully launched browser on remote machine with specified URL and execute couple of other actions which are mentioned in the same script, this is a success part.

If I add couple of other scripts (scrtipt b, script c) in test suite after start browser script, the other scripts will not execute, which is failure. This is the exception I can see on console tab

Caught: com.github.kklisura.cdt.services.exceptions.ChromeServiceException: Failed sending HTTP request.
com.github.kklisura.cdt.services.exceptions.ChromeServiceException: Failed sending HTTP request.
	at com.github.kklisura.cdt.services.impl.ChromeServiceImpl.request(ChromeServiceImpl.java:292)
	at com.github.kklisura.cdt.services.impl.ChromeServiceImpl.getTabs(ChromeServiceImpl.java:127)
	at com.kms.katalon.core.util.CDTUtils.getService(CDTUtils.java:31)
	at com.kms.katalon.core.helper.screenrecorder.CDTVideoRecorder.startCDTRecording(CDTVideoRecorder.java:116)
	at com.kms.katalon.core.helper.screenrecorder.CDTVideoRecorder.start(CDTVideoRecorder.java:90)
	at com.kms.katalon.core.helper.screenrecorder.VideoRecorder.start(VideoRecorder.java:51)
	at com.kms.katalon.core.context.internal.VideoRecorderService.startBrowserRecorder(VideoRecorderService.java:172)
	at com.kms.katalon.core.context.internal.VideoRecorderService.handleListenerEvent(VideoRecorderService.java:111)
	at com.kms.katalon.core.context.internal.ExecutionEventManager.publicEvent(ExecutionEventManager.java:36)
	at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:268)
	at com.kms.katalon.core.common.CommonExecutor.accessTestCaseMainPhase(CommonExecutor.java:65)
	at com.kms.katalon.core.main.TestSuiteExecutor.accessTestSuiteMainPhase(TestSuiteExecutor.java:150)
	at com.kms.katalon.core.main.TestSuiteExecutor.execute(TestSuiteExecutor.java:106)
	at com.kms.katalon.core.main.TestCaseMain.startTestSuite(TestCaseMain.java:180)
	at TempTestSuite1734421489191.run(TempTestSuite1734421489191.groovy:35)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Caused by: java.net.ConnectException: Connection refused: connect
	at com.github.kklisura.cdt.services.impl.ChromeServiceImpl.request(ChromeServiceImpl.java:273)
	... 17 more

Any thoughts in this?

Any help in this regard would be appreciated.

Regards,

1 Like

connection failure. remote machine refusing to establish connection

does script b or c ran successfully on standalone mode in remote machine?

Yes, they run successfully on local machine

But the point is, first script executed successfully and when next try to run, why is this happening? If there are any connection problem then none should be executed

without knowing what your first script and script two , it’s difficult to infer. is your first script and second script same?

I think issue is not with the scripts because these scripts are working for ages in normal circumstances.

Script A - Initialize a driver and launch chorme browser with a URL.
Scrpt B - Login to application.
Script C - Logout from application and close the browser.

Another finding is - If I call these or any other script from setup section of a test suite, they all will work. But calling them from normal flow of test suite always run first script successfully and for later scripts, have an exception as mentioned above.