Chrome opens with "data"; with selenium

I am new to Selenium and trying to open the localhost: 3000 page from Chrome through the selenium driver. The code:

import com.google.common.base.Function; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriverException; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.firefox.FirefoxDriver; public class SeleniumTests { public static void main(String[] args) { System.setProperty("webdriver.chrome.driver", "C://chromedriver_win32//chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.get("localhost:3000"); } } 

However, this opens my chrome window with "data" ;, The chrome version is 50.0.2661.94

Any idea what the problem is?

+12
google-chrome google-chrome-devtools selenium selenium-webdriver ui-automation
source share
6 answers

Specify the protocol you are using, instead of localhost:3000 use http://localhost:3000 . If this does not help, see the comment here in the Chromium tracker.

+5
source share

I also had a problem. I updated the chrome driver and the problem was resolved.

+4
source share

Make sure you are using the latest version of ChromeDriver (as of now it's 2.28). I had the same problem with data:, . By mistake, I downloaded the old version and got a problem with the specified URL, which does not open, just data:,

+2
source share

Yes, it will start with data. After the data just try to specify the URL. Data URL :, this is only the default address that the chrome rail goes to when chrome starts. Thus, this in itself does not necessarily mean that something is going wrong.

 import com.google.common.base.Function; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriverException; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.firefox.FirefoxDriver; public class SeleniumTests { public static void main(String[] args) { System.setProperty("webdriver.chrome.driver", "C://chromedriver_win32//chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.get("https://www.google.co.in/?gfe_rd=cr&ei=KxAzV8-KEJPT8gfT0IWYAw"); } } 

It will be successfully opened. Answer if you have a request. Happy Learning .. :-)

0
source share

I worked in a similar situation, the fix in my case was just updating the chrome webdriver to the latest version (in my case V2.27).

Reason for displaying Data; instead of the real application URL was that:

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

failed to create. Instead, the driver object was null .

So, after updating the chrome driver, it was created correctly and the problem is solved.

Hope this helps those who are still stuck!

0
source share

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

0
source share

All Articles