We are having an issue running a Robot Framework automated test script is executed on a DevOps build pipeline, run on a self-hosted build agent on our windows server and running as a service (using Network services)
We are getting the following error - WebDriverException: Message: unknown error: DevToolsActivePort file doesn't exist
The server that has the following version of chromedriver / chrome installed:
ChromeDriver version 95.0.4638.69 installed on the d:\drive (path=D:/Python/Scripts/chromedriver.exe)
Chrome browser version 95.0.4638.69 installed on the c:\drive (path: C:/Program Files/Google/Chrome/Application/chrome.exe)
The chromedriver executable path is in the server system environment variable "Path" and appears under "Path" in the self-hosed build agent system capabilities.
The same script can be run successfully on a local computer, when changing the Open Browser keyword with the relevant chrome browser binary and chromedriver executable paths of the local computer.
When we try to run our automation scripts, we are getting the following webdriver error messages and the webdriver does not initiate/spawn a new web browser:
TC001 Open Google Home Page                                                   
==============================================================================
Open Google Home Page :: Open Google website with the chrome brows... | FAIL |
Parent suite setup failed:
WebDriverException: Message: unknown error: DevToolsActivePort file doesn't exist
Code run
*** Settings ***
Library  SeleniumLibrary
Library  CL_Auto_Library
Suite Setup      Open Chrome        https://www.google.com/
Suite Teardown   Close All Browsers
*** Variables ***
${chromeserver_options}   ${EMPTY}
${expected_page_title}    Google
*** Test Cases ***
Open Google Home Page
    [Documentation]    Open Google website with the chrome browser and validate the user is on the Google home page
    Home Page Should be Loaded  ${expected_page_title}
*** Keywords ***
Open Chrome
     [Arguments]         ${url}
     [Documentation]     Open the Chrome browser and go to the URL provided in the ${url} argument
     ...                 ${url}      URL of the application being testing
    
     ${chromeserver_options}=    Evaluate    sys.modules['selenium.webdriver'].ChromeOptions()    sys, selenium.webdriver
     ${options.binary_location}    Set Variable    'C:/Program Files/Google/Chrome/Application/chrome.exe' --remote-debugging-port=9515 
     Call Method         ${chromeserver_options}   add_argument     --user-data-dir\=C:/Temp/ChromeProfile
     Call Method         ${chromeserver_options}   add_argument     --profile-directory\=Default
     Call Method         ${chromeserver_options}   add_argument     --ignore-certificate-errors
     Call Method         ${chromeserver_options}   add_argument     --disable-web-security
     Call Method         ${chromeserver_options}   add_argument     --disable-gpu
     Create Webdriver    Chrome    chrome_options=${chromeserver_options}    executable_path=D:/Python/Scripts/chromedriver.exe
     Go To          ${url}
     Maximize Browser Window
Home Page Should be Loaded
     [Arguments]        ${expected_page_title}
     [Documentation]    Validate that the home page of the Google webiste has been successfully loaded
     ...                ${expected_page_title}  the expected page title of the home page
     Wait Until Keyword Succeeds   2x  1s    Title Should Be    ${expected_page_title}
We've gotten Edge to work fine in our test. We're just having lots of issues with Chrome right now.
Thanks
