Chrome opens with “Data;” with selenium

后端 未结 9 1474
轻奢々
轻奢々 2020-12-16 10:25

I am a newbie to Selenium and trying to open localhost:3000 page from Chrome via selenium driver. The code is :

import com.google.common.base.Function;
imp         


        
9条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-16 11:03

    You need to add two things to run :

    First - you should use http://localhost:3000

    Second - You must use debug port before creating webDriver as : options.addArguments("--remote-debugging-port=9225");

    Whole Code:

        WebDriverManager.chromedriver().setup();
        ChromeOptions options = new ChromeOptions();
        options.setExperimentalOption("useAutomationExtension", false);
        options.addArguments("--remote-debugging-port=9225");
        WebDriver driver = new ChromeDriver(options);
    

    Drop comments if you have any query

提交回复
热议问题