I\'m using the following code in RSelenium to open a browser. After I close the browser, or even close the handler by running remDr$close(), the port is still in use. I have
I did not have issues until recently. What worked for me is to use the solution above and as per the solution in this thread to add a line to kill the Java instance(s) inside RStudio.
remDr$close()
driver$server$stop()
rm(driver, remDr)
gc()
system("taskkill /im java.exe /f", intern=FALSE, ignore.stdout=FALSE)