RSelenium rdDriver() Could not open chrome browser - r

My code:
driver <- rsDriver(browser="chrome", port=4234L, chromever = "89.0.4389.23")
and output:
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] "Connecting to remote server"
Selenium message:Timed out waiting for driver server to start.
Build info: version: '4.0.0-alpha-2', revision: 'f148142cf8', time: '2019-07-01T21:30:10'
System info: host: 'blah.blah.blah', ip: '2601:602:9403:400:0:0:0:f690%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.7', java.version: '15.0.2'
Driver info: driver.version: unknown
Could not open chrome browser.
Client error message:
Summary: UnknownError
Detail: An unknown server-side error occurred while processing the command.
Further Details: run errorDetails method
Check server log for further details.
I have also used chromever="latest" and tried different ports. The selenium-server-standalone.jar is in the working directory as well as the chromedriver.exe in case that is important.
I have been able to start a selenium server on this port from the command line using the same .jar and .exe files and then tried the code
browser <- remoteDriver(port = 4234L, browserName = "chrome")
browser$open()
only to get the error:
Selenium message:Unable to create new service: ChromeDriverService
Build info: version: '4.0.0-alpha-2', revision: 'f148142cf8', time: '2019-07-01T21:30:10'
System info: host: 'blah.blah.blah', ip: '2601:602:9403:400:0:0:0:f690%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.7', java.version: '15.0.2'
Driver info: driver.version: unknown
Error: Summary: SessionNotCreatedException
Detail: A new session could not be created.
Further Details: run errorDetails method
I feel as if the "Driver info: driver.version: unknown" is the problem, which I think refers to the chromedriver but I'm not sure. I am quite positive that "89.0.4389.23" is my chrome version and that java, selenium, chrome are all very up-to-date versions.
Any thoughts would be appreciated, thanks.

Related

Timed Out Error When Running rsDriver in Rselenium

I'm trying to use RSelenium, and when I'm trying to use rsDriver, I keep getting a weird error that I'm not sure how to handle. My code is as follows:
library(RSelenium)
library(rvest)
library(XML)
rD <- rsDriver(port = 4567L, browser = "chrome")
remDr <- rD$client
As I'm running the code, I get the following error:
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] "Connecting to remote server"
Selenium message:Timed out waiting for driver server to start.
Build info: version: '4.0.0-alpha-2', revision: 'f148142cf8', time: '2019-07-01T21:30:10'
System info: host: 'Stephens-MacBook-Pro.local', ip: '2601:647:5680:6250:0:0:0:e510%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '11.5.2', java.version: '1.8.0_333'
Driver info: driver.version: unknown
Could not open chrome browser.
Client error message:
Summary: UnknownError
Detail: An unknown server-side error occurred while processing the command.
Further Details: run errorDetails method
Check server log for further details.
Any advice as to what the error might be would be greatly appreicated!

Salt stack: how to set up a package installation check with Chocolate (state)

During the execution of the state, the manager "Chocolate" installs the package RealVNC (Program Files\Real VNC)
Next, I create a key in the registry.
I want the keys to be created only if the VNC installation was successful.
I have tried
Require:
- pkg: realvnc
Watch:
- file: C:\Program Files\Real VNC\vncserver.exe
Both options tell me that the target is not found
Sls
realvncsetup:
chocolatey.installed:
- name: realvnc
reg1:
reg.present:
- name: HKEY_LOCAL_MACHINE\SOFTWARE\RealVNC\vncserver
- vname: EnableAnalytics
- vdata: "0"
- vtype: REG_SZ
- watch:
- file: "C:\\Program Files\\RealVNC\\VNC Server"
Error
ID: reg1
Function: reg.present
Name: HKEY_LOCAL_MACHINE\SOFTWARE\RealVNC\vncserver
Result: False
Comment: The following requisites were not found:
require:
file: C:\Program Files\RealVNC\VNC Server
Started: 12:39:20.183205
Duration: 0.0 ms
Changes:
salt --versions
Salt Version:
Salt: 3002.1
Dependency Versions:
cffi: 1.12.2
cherrypy: unknown
dateutil: 2.7.3
docker-py: 3.4.1
gitdb: 2.0.5
gitpython: 2.1.11
Jinja2: 2.10
libgit2: 0.27.7
M2Crypto: Not Installed
Mako: 1.0.7
msgpack-pure: Not Installed
msgpack-python: 0.5.6
mysql-python: 1.3.10
pycparser: 2.19
pycrypto: 2.6.1
pycryptodome: 3.6.1
pygit2: 0.27.4
Python: 3.7.3 (default, Jul 25 2020, 13:03:44)
python-gnupg: 0.4.4
PyYAML: 3.13
PyZMQ: 17.1.2
smmap: 2.0.5
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.3.1
System Versions:
dist: debian 10 buster
locale: UTF-8
machine: x86_64
release: 4.19.0-6-amd64
system: Linux
version: Debian GNU/Linux 10 buster
The requisites that we mention, such as require, watch, etc. should be references to other states that are "scheduled" to run on the targets.
About watch
Even though the path is created by installing the "realvnc" package, there is no Salt state to handle the path. That is why it is showing the error.
Quoting from documentation for watch:
A watch requisite is used to add additional behavior when there are changes in other states.
So if you want to watch on a file, then there should be a state that "handles" the file using the file module.
About require
Also, while specifying require you are referring to pkg module, so Saltstack would look for pkg.installed for realvnc. Whereas you are using chocolatey.installed.
So with below modifications it should work fine.
chocolatey-install-realvnc:
chocolatey.installed:
- name: realvnc
# Use the appropriate path that should exist when realvnc is installed
check-progfiles-path:
file.exists:
- name: 'C:\Program Files\Real VNC\vncserver.exe'
# You can use either or both for require as you see fit
create-registry-entry:
reg.present:
- name: HKEY_LOCAL_MACHINE\SOFTWARE\RealVNC\vncserver
- vname: EnableAnalytics
- vdata: "0"
- vtype: REG_SZ
- require:
- file: 'C:\Program Files\Real VNC\vncserver.exe'
- chocolatey: realvnc

Connection refused error when attempting to use RSelenium chromedriver

I run
require(RSelenium)
driver <-
rsDriver(
browser = c("chrome"),
chromever = "83.0.4103.14",
port = as.integer(4445L)
)
which returns
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] "Connecting to remote server"
Could not open chrome browser.
Client error message:
Undefined error in httr call. httr output: Failed to connect to localhost port 1242: Connection refused
Check server log for further details.
I get the same problem attempting to use the remoteDriver function with docker:
system("sudo docker pull selenium/standalone-chrome",wait=T)
Sys.sleep(5)
system("sudo docker run -d -p 4445:4444 selenium/standalone-chrome",wait=T)
Sys.sleep(5)
#remDr <- remoteDriver(port=4445L, browserName="chrome")
remDr <- RSelenium::remoteDriver(remoteServerAddr = "192.168.99.100",
port = 4445L, browserName = "chrome")
remDr$open()
It doesn't work for firefox, and up until now it has been working perfectly with the exact same code. Any help would be much appreciated (I've been through the other answers on this error message and can't find anything that fixes it).
Finally solved this. If you run:
sel <- wdman::selenium()
sel$log()
it should show you any errors thrown up when trying to initialise selenium. In this case the path to the java binary was incorrect (no idea why it changed on its own).
So I simply re-followed the steps mentioned here: "PATH to JAVA not found. Please check JAVA is installed." error when initialising RSelenium
and it worked.

RSelenium - rsDriver(browser = "firefox") -> Conection Refused

I'm trying to use Selenium for the first time in my computer. But I'm having an error in the first line:
My code:
library(RSelenium)
rD <- rsDriver(browser = "firefox")
Error message:
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] "Connecting to remote server"
Could not open firefox browser.
Client error message:
Undefined error in httr call. httr output: Failed to connect to localhost port 4567: Conection Refused
Check server log for further details.
Warning message:
In rsDriver(browser = "firefox") : Could not determine server status.
My OS is Linux Mint, 19.3, Cinnamon.
I installed selenium-server-standalone-3.141.59.jar and geckodriver-v0.26.0
Try this FIRST:
suppressWarnings(tryCatch(rm(remDr),error=function(e){}))
suppressWarnings(tryCatch(rD),error=function(e){}))
gc()
#relaunch
library(RSelenium)
rD <- rsDriver(browser = "firefox")
remDr <- rD$client
remDr$navigate("https://www.duckduckgo.com")
Alternatively this:
#make sure lsof is installed on your system:
#sudo apt-get install ssh-askpass lsof
system("kill -9 $(lsof -t -i:4567 -sTCP:LISTEN)")
#might need to be run sudo depending on your system
system("sudo kill -9 $(lsof -t -i:4567 -sTCP:LISTEN)")
#relaunch
library(RSelenium)
rD <- rsDriver(browser = "firefox")
remDr <- rD$client
remDr$navigate("https://www.duckduckgo.com")
If none of that works, you may have installed the wrong geckodriver. Uninstall geckodriver from linux (sudo apt-get remove geckodriver --purge) and uninstall RSelenium from R (remove.packages("RSelenium")). Then DO NOT re-install geckodriver, but make sure you have all firefox dependencies (run sudo apt-get install firefox). Re-install RSelenium (in R), then try re-launching again without manually downloading geckodriver. In this way RSelenium will automatically download the correct geckodriver version.

how do i install mariadb on ubuntu 16.04

i have been trying to install mariadb on my ubuntu machine but the error ii keep getting is shown on the link below
https://imgur.com/9LOtUk9 "Error Image"
tried uninstalling mysql and mariadb nd reinstalled mariadb all over again
apt-get install mariadb-server
my expected result is below when i try to check the status after installation
mariadb.service - MariaDB 10.3.10 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/mariadb.service.d
└─migrated-from-my.cnf-settings.conf
Active: active (running)
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Main PID: 15152 (mysqld)
Status: "Taking your SQL requests now..."
CGroup: /system.slice/mariadb.service
└─15152 /usr/sbin/mysqld

Resources