Search code examples
rrselenium

why is there still an Error in rsDriver in RSelenium in R even after deleting the LICENSE.chromedriver file?


Dear Members, I am using RSelenium and am getting the following error message when using rsDriver:

> rD <- rsDriver(port=free_port(random=TRUE),browser="chrome",chromever="109.0.5414.25",verbose=FALSE)
Could not open chrome browser.
Client error message:
Undefined error in httr call. httr output: Failed to connect to localhost port 795: Connection refused
Check server log for further details.
Warning message:
In rsDriver(port = free_port(random = TRUE), browser = "chrome",  :
  Could not determine server status.

I have successfully deleted the LICENSE.chromedriver file as mentioned here: https://github.com/ropensci/wdman/issues/31

but am bootless...please help....

output of selenium(retcommand =T)

> library(wdman)
> selenium(retcommand = T)
checking Selenium Server versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking chromedriver versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking geckodriver versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking phantomjs versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
[1] "C:\\PROGRA~1\\COMMON~1\\Oracle\\Java\\javapath\\java.exe -Dwebdriver.chrome.driver=\"C:\\Users\\Administrator\\AppData\\Local\\binman\\binman_chromedriver\\win32\\110.0.5481.30/chromedriver.exe\" -Dwebdriver.gecko.driver=\"C:\\Users\\Administrator\\AppData\\Local\\binman\\binman_geckodriver\\win64\\0.32.0/geckodriver.exe\" -Dphantomjs.binary.path=\"C:\\Users\\Administrator\\AppData\\Local\\binman\\binman_phantomjs\\windows\\2.1.1/phantomjs-2.1.1-windows/bin/phantomjs.exe\" -jar \"C:\\Users\\Administrator\\AppData\\Local\\binman\\binman_seleniumserver\\generic\\4.0.0-alpha-2/selenium-server-standalone-4.0.0-alpha-2.jar\" -port 4567"

error message after changing chromever = ""110.0.5481.30" :

>  rD <- rsDriver(port=free_port(random=TRUE),browser="chrome",chromever="110.0.5481.30",verbose=FALSE)

Selenium message:session not created: This version of ChromeDriver only supports Chrome version 110
Current browser version is 109.0.5414.75 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe
Build info: version: '4.0.0-alpha-2', revision: 'f148142cf8', time: '2019-07-01T21:30:10'
System info: host: 'EC2AMAZ-1JRGETJ', ip: '172.31.9.48', os.name: 'Windows Server 2016', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.1'
Driver info: driver.version: unknown
remote stacktrace: Backtrace:
    (No symbol) [0x00C53643]
    (No symbol) [0x00BE8981]
    (No symbol) [0x00AEB35D]
    (No symbol) [0x00B0ED2D]
    (No symbol) [0x00B09B50]
    (No symbol) [0x00B06F89]
    (No symbol) [0x00B41EB5]
    (No symbol) [0x00B41B0C]
    (No symbol) [0x00B3B1F6]
    (No symbol) [0x00B10D57]
    (No symbol) [0x00B124FD]
    GetHandleVerifier [0x00ECB5F2+2513186]
    GetHandleVerifier [0x00EFB730+2710112]
    GetHandleVerifier [0x00EFECDC+2723852]
    GetHandleVerifier [0x00D02250+640384]
    (No symbol) [0x00BF1142]
    (No symbol) [0x00BF6AD8]
    (No symbol) [0x00BF6BBB]
    (No symbol) [0x00C009FB]
    BaseThreadInitThunk [0x768262C4+36]
    RtlSubscribeWnfStateChangeNotification [0x76F31B69+1081]
    RtlSubscribeWnfStateChangeNotification [0x76F31B34+1028]


Could not open chrome browser.
Client error message:
     Summary: SessionNotCreatedException
     Detail: A new session could not be created.
     Further Details: run errorDetails method
Check server log for further details.

output of binman::list_versions("chromever")

> library(binman)
> list_versions("chromedriver")
$win32
 [1] "100.0.4896.20" "100.0.4896.60" "101.0.4951.15" "101.0.4951.41" "102.0.5005.27"
 [6] "102.0.5005.61" "103.0.5060.24" "103.0.5060.53" "104.0.5112.20" "104.0.5112.29"
[11] "106.0.5249.61" "107.0.5304.18" "107.0.5304.62" "108.0.5359.22" "108.0.5359.71"
[16] "109.0.5414.25" "109.0.5414.74" "110.0.5481.30" "96.0.4664.45"  "97.0.4692.20" 
[21] "97.0.4692.36"  "97.0.4692.71"  "98.0.4758.48"  "98.0.4758.80"  "99.0.4844.17" 
[26] "99.0.4844.35"  "99.0.4844.51" 

BUT MY CHROME VERSION IS:

 Chrome is up to date
Version 109.0.5414.75 (Official Build) (64-bit)

Output from selenium(retcommand = T, chromever = "109.0.5414.25")

> selenium(retcommand = T,chromever = "109.0.5414.25")
checking Selenium Server versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking chromedriver versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking geckodriver versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking phantomjs versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
[1] "C:\\PROGRA~1\\COMMON~1\\Oracle\\Java\\javapath\\java.exe c(\"-Dwebdriver.chrome.driver=\\\"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\binman\\\\binman_chromedriver\\\\win32\\\\109.0.5414.25/chromedriver.exe\\\"\", \"-Dwebdriver.chrome.driver=\\\"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\binman\\\\binman_chromedriver\\\\win32\\\\109.0.5414.25/LICENSE.chromedriver\\\"\") -Dwebdriver.gecko.driver=\"C:\\Users\\Administrator\\AppData\\Local\\binman\\binman_geckodriver\\win64\\0.32.0/geckodriver.exe\" -Dphantomjs.binary.path=\"C:\\Users\\Administrator\\AppData\\Local\\binman\\binman_phantomjs\\windows\\2.1.1/phantomjs-2.1.1-windows/bin/phantomjs.exe\" -jar \"C:\\Users\\Administrator\\AppData\\Local\\binman\\binman_seleniumserver\\generic\\4.0.0-alpha-2/selenium-server-standalone-4.0.0-alpha-2.jar\" -port 4567

Solution

  • UPDATE: The issue was solved by making sure the LICENSE file for the correct chromever was deleted. In this case, the original poster deleted the LICENSE.chromever for a different version of chromedriver.

    binman/wdman will download and create a new folder for each version of each driver. This means that you will only run into this issue once if you specify a version of chromedriver to use. On the other hand, the default behavior for binman/wdman to take the latest chromever will mean that the release of a new chrome driver could break your code even if you are not using the chrome browser within RSelenium

    Running selenium(retcommand = T) will tell you how RSelenium is attempting to find your chromedriver. You can look at the output to find the filepath of the chromedriver. The biggest flag to look for is a R style "c()" vector in the output of retcommand. If that happens then you must delete the LICENSE.chromedriver file

    Example from AKshayKulkarni

    library(wdman)
    selenium(retcommand = T,chromever = '109.0.5414.25')
    

    Note that after java.exe a R vector starts with "c(" meaning that the LICENSE.chromedriver in that folder needs to be deleted.

    [1] "C:\\PROGRA~1\\COMMON~1\\Oracle\\Java\\javapath\\java.exe c(\"-Dwebdriver.chrome.driver=\\\"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\binman\\\\binman_chromedriver\\\\win32\\\\109.0.5414.25/chromedriver.exe\\\"\", \"-Dwebdriver.chrome.driver=\\\"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\binman\\\\binman_chromedriver\\\\win32\\\\109.0.5414.25/LICENSE.chromedriver\\\"\") -Dwebdriver.gecko.driver=\"C:\\Users\\Administrator\\AppData\\Local\\binman\\binman_geckodriver\\win64\\0.32.0/geckodriver.exe\" -Dphantomjs.binary.path=\"C:\\Users\\Administrator\\AppData\\Local\\binman\\binman_phantomjs\\windows\\2.1.1/phantomjs-2.1.1-windows/bin/phantomjs.exe\" -jar \"C:\\Users\\Administrator\\AppData\\Local\\binman\\binman_seleniumserver\\generic\\4.0.0-alpha-2/selenium-server-standalone-4.0.0-alpha-2.jar\" -port 4567
    

    Original answer:

    Can you run

    library(wdman)
    selenium(retcommand = T)
    

    and post the results?