Error while running RSelenium

Hi all, I am following the instructions from this link (https://mran.microsoft.com/snapshot/2018-02-12/web/packages/RSelenium/vignettes/shinytesting.html#rselenium-testing-shiny-apps)
to test the applications. It says we need to run the below code to run a basic R file. But i am getting following error. Can anyone guide me please

test_dir(paste0(find.package("RSelenium"), "/apps/shinytestapp/tests/"), filter = 'basic', reporter = "Tap")
1..1
# Context basic
not ok 1 (unknown)
  Undefined error in httr call. httr output: Failed to connect to localhost port AAAA: Connection refused
  Backtrace:
   1. remDr$open(silent = TRUE) apps/shinytestapp/tests/test-basic.r:12:0
   2. RSelenium:::queryRD(qpath, "POST", qdata = serverOpts)
   3. RSelenium:::checkError(res)

hi @vinayprakash808 ;

In the doc, it's say that "For testing purposes we assume the app is running locally." . Did you run the app before? in the example, they try to connect to the local app http://127.0.0.1:6012.

The full content of foc :

We have a context of “basic” for the tests in this file. The test “can connect to app” simply navigates to the app URL and attempts to get the page title. If the page title is “Shiny Test App” the test is deemed successful. For testing purposes we assume the app is running locally. The easiest way to do this is open a second R session and issue the command: runApp(paste0(find.package("RSelenium"), "/apps/shinytestapp"), port = 6012). The second R session will listen for connection on port 6012 and return the Shiny Test App. If we ran this basic test we would expect the following output:

Hope it help

I'm not sure if I understand yr answer.

You must have two sessions locally,

  • One who run the app (runApp(paste0(find.package("RSelenium"), "/apps/shinytestapp"), port = 6012)) and

  • the second who test (test_dir(paste0(find.package("RSelenium"), "/apps/shinytestapp/tests/"), filter = 'basic', reporter = "Tap"))

Did you do that?

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

Thanks for the time. Yes I run it locally. Should not we??

Hi,

Yeah I run both these codes