Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remDr$log("browser") does not show console.log() messages #249

Open
gorkang opened this issue Jun 11, 2021 · 0 comments
Open

remDr$log("browser") does not show console.log() messages #249

gorkang opened this issue Jun 11, 2021 · 0 comments

Comments

@gorkang
Copy link

gorkang commented Jun 11, 2021

remDr$log("browser") shows console.warn() and console.error() messages, but does NOT show console.log() messages.

The expected behavior is that console.log() outputs would also be shown.

Please find a reproducible example below:

system('docker stop $(docker ps -q)')
system("docker run -d --shm-size=2g -p 4445:4444 -p 5901:5900 selenium/standalone-chrome-debug")

library(RSelenium)

remDr <- remoteDriver(port=4445L, browserName = "chrome") ##4445 for mac. windows can use 4444
remDr$open(silent = TRUE)
remDr$navigate("https://google.com")


# Gets warnings and errors as expected

remDr$executeScript("console.warn('This is a warning message')")
#> list()
remDr$log("browser")
#> [[1]]
#> [[1]]$level
#> [1] "WARNING"
#> 
#> [[1]]$message
#> [1] "console-api 2:32 \"This is a warning message\""
#> 
#> [[1]]$source
#> [1] "console-api"
#> 
#> [[1]]$timestamp
#> [1] 1.623427e+12

remDr$executeScript("console.error('This is an error message')")
#> list()
remDr$log("browser")
#> [[1]]
#> [[1]]$level
#> [1] "SEVERE"
#> 
#> [[1]]$message
#> [1] "console-api 2:32 \"This is an error message\""
#> 
#> [[1]]$source
#> [1] "console-api"
#> 
#> [[1]]$timestamp
#> [1] 1.623427e+12


# Does NOT get console.log :(

remDr$executeScript("console.log('This is a log message')")
#> list()
remDr$log("browser")
#> list()

Created on 2021-06-11 by the reprex package (v2.0.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant