Chrome opens with “Data;” with selenium

后端 未结 9 1364
轻奢々
轻奢々 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:00

    If you're using Codeception, start the test with :

    $I->amOnPage('/');

    0 讨论(0)
  • 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

    0 讨论(0)
  • 2020-12-16 11:06

    I've been running in a similar situation, the fix in my case was simply to upgrade chrome webdriver to its latest version (in my case V2.27).

    The cause of showing Data; instead of the real application URL was that:

    WebDriver driver = new RemoteWebDriver(new URL("http://<host>:<port>/wd/hub"), desiredCapabilities);
    

    failed to get created. Instead, driver object was holding a null value.

    So after chrome driver upgrade , it had been created correctly and problem solved.

    Hope this helps who's still stuck!

    0 讨论(0)
  • 2020-12-16 11:10

    Make sure you are using latest release of ChromeDriver (as for now it's 2.28). I had same problem with data:,. By mistake I've downloaded old version and got the issue with specified URL not being opened, just data:,

    0 讨论(0)
  • 2020-12-16 11:12

    just replace the "chromedriver.exe" with latest release of ChromeDriver.

    0 讨论(0)
  • 2020-12-16 11:16

    Specify the protocol you are using, so instead of localhost:3000, use http://localhost:3000. If that doesn't help, see the comment here on the Chromium issue tracker.

    0 讨论(0)
提交回复
热议问题