Chrome opens with "Data;" with selenium
Solution 1
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.
Solution 2
I was also getting the same issue. I updated ChromeDriver to the latest version and that fixed it.
Solution 3
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:,
Solution 4
Yes it will start with data. After data just try to give the URL.The 'data:,' URL is just the default address that chromedriver navigates to when launching chrome. So this by itself doesn't necessarily mean that anything 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 open successfully. Reply if you have any query. Happy Learning.. :-)
Solution 5
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!
learntogrow-growtolearn
Updated on February 12, 2021Comments
-
learntogrow-growtolearn over 3 years
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; 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 a "data;" . The chrome version is 50.0.2661.94
Any idea what is the exact issue?