Search code examples
rfirefoxbrowserrselenium

Why is RSelenium always giving an error when I want to define a Firefox profile


I am using RSelenium and want to set a Firefox profile. So I tried to reproduce the example of the answer to this question. However, no matter what I change I always get the following error. What am I doing wrong?

I already read in the RSelenium manual that for windows systems RTools should be installed when one wants to make a Firefox profile. I did but nothing changed.

The error is the following:

Error in file(tmpfile, "rb") : cannot open the connection
In addition: Warning messages:
1: running command '"zip" -r9Xjq "C:\Users\mariu\AppData\Local\Temp\RtmpQfl3bl\file15c41fc2411d.zip" "C:\Users\mariu\AppData\Local\Temp\RtmpQfl3bl/firefoxprofile/prefs.js" ' had status 127 
2: In file(tmpfile, "rb") :
  cannot open file 'C:\Users\mariu\AppData\Local\Temp\RtmpQfl3bl\file15c41fc2411d.zip': No such file or directory

Solution

  • the problem is that Rselenium cannot create a zip file of your Firefox Profile (error status 127), therefore cannot read it in the next command line.

    I resolved following this answer: Create zip file: error running command " " had status 127 .

    Do as the link says , shut down R, restart your pc and it should work.

    Thanks, Rob