"Warning: Potential Security Risk Ahead" Error in Rselenium and Geckodriver-firefox

Viewed 1321

I'm trying to access a page with RSelenium. I wrote my code in R and it is work fine in Chrome and IE. But when I'm using geckodriver, the firefox shows the below message and i recive an error in my R console:

enter image description here

Selenium message:
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info:os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_40'
Driver info: driver.version: unknown

Error:   Summary: UnknownError
     Detail: An unknown server-side error occurred while processing the command.
     class: org.openqa.selenium.WebDriverException
     Further Details: run errorDetails method

I found that I should change the firefox profile but it is the python code and I need R:

FirefoxProfile profile = new FirefoxProfile();
profile.setAcceptUntrustedCertificates(true);

It should be like this in R

fprof <- makeFirefoxProfile(list(browser.download.dir = "D:/temp"))
remDr <- remoteDriver(extraCapabilities = fprof)

but i don't know what should I write exactly.

Would you please help me. Or if you know how I could deactivate this warning!

1 Answers

Selenium requires that you set both the acceptInsecureCerts and acceptUntrustedCerts to TRUE. Besides, remoteDriver has been deprecated, so you now have to use rsDriver, as demonstrated here:

remDr=rsDriver(browser=browserName,extraCapabilities=list(acceptInsecureCerts=TRUE,acceptUntrustedCerts=TRUE))
Related