简体   繁体   中英

Rselenium issue: browser opens and closes with an error

There is some issue with RSelenium. It shows the below error

rD <- rsDriver(port=4444L,browser="chrome")
remDr <- rD$client

The browser opens and closes with error

Selenium message:unknown error: unable to discover open pages
(Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 60.76 seconds Build info: version: '3.4.0', revision: 'unknown', time: 'unknown' System info: host: 'HYD2-1860002767', ip: '10.54.67.19', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_131' Driver info: driver.version: ChromeDriver

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

How to overcome this error?

Make sure you have correctly added stand alone jar in your project. You can download it from official site of seleniumhq. java -jar selenium-server-standalone-x.xx.x.jar

Should you have successfully added jar, try the code below:

`

public class Google {

    public static void main(String[] args) throws InterruptedException {
        System.setProperty("webdriver.chrome.driver","***location of your chromedriver.exe***");
        WebDriver driver = new ChromeDriver();
        driver.manage().window().maximize();
        driver.get("https://www.google.com/");
        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);        

`

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM