Reputation: 21
I am attempting to test a packaged Electron application (an .exe) with RobotFramework on a windows 10 machine. I have other RobotFramework tests for other web applications that are running fine on the same machine.
I have the chromedriver of what I believe to be the correct version within the same directory as my .robot script. I have also tried different version of the chromedriver.exe. Currently I am using chromedriver 80.0.3987.16 The package.json of my app indicates that the electron version is 5.0.1
I have created a vars.py file and have the robot script instantiate the driver with the code as indicated in https://spage.fi/electron
As prescribed by the spage.fi link: within the vars.py file:
binary_location = {"chromeOptions": {"binary": "myelectronapp.exe"}}
Note that the .exe and its associated files from the package process I've included in the same directory as the robot script in order to remove any path dependancies.
My robot snippet:
*** Settings ***
Documentation Suite description
Library SeleniumLibrary
Variables vars.py
*** Test Cases ***
Test title
[Tags] DEBUG
Log To Console calling create driver
Create Webdriver Remote desired_capabilities=${binary_location} command_executor=http://localhost:9515
My port 9515 is open via an inbound rule.
My experience has been regardless of the chromedriver version that I think aligns, that I always get a connection refusal error:
[ WARN ] Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000000003E3C160>: Failed to establish a new connection: [WinE
rror 10061] No connection could be made because the target machine actively refused it')': /session
x 3 retries
I'm figuring it is not a port accessibility issue because when I run chromedriver from the command line and then invoke the url at port 9515, I get the callback trace that I would expect.
Its difficult to know if this is from a syntax issue or some other connection attribute that I have overlooked.
Upvotes: 1
Views: 523
Reputation: 193088
This error message...
[ WARN ] Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000000003E3C160>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')': /session
...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session.
Your main issue is the incompatibility between the version of the binaries you are using as follows:
Supports Chrome version 80
Supports Chrome 79
So there is a clear mismatch between the ChromeDriver v80.0 and the Chrome Browser v79.0
Ensure that:
@Test
as non-root user.driver.quit()
within tearDown(){}
method to close & destroy the WebDriver and Web Client instances gracefully.Upvotes: 0