Search code examples
javagoogle-chromeseleniumchrome-web-driver

Chrome opens with "Data;" adress with selenium


When I'm starting the test I see 'data:,' in the chrome address bar and then nothing happens (the program doesn't continue) instead of starting navigating to the url. I am using: chrome=55.0.2883.75 chromedriver=2.25 selenium=3.0.1 platform=Win64

import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import static org.junit.Assert.assertEquals;

public class MyClass {

    public static void main(String[] args) {
        WebDriver driver;
        System.setProperty("webdriver.chrome.driver", "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chromedriver_win32\\chromedriver.exe");
        driver = new ChromeDriver ();
        driver.get("http://www.google.com");
        driver.manage().window().maximize();
        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
        driver.findElement(By.xpath("//*[@id='lst-ib']")).sendKeys("facebook");
        driver.findElement(By.cssSelector("input[name='btnK']")).click();
        driver.findElement(By.linkText("Facebook - Log In or Sign Up")).click();

        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
        WebDriverWait wait = new WebDriverWait(driver, 10);
        wait.until(ExpectedConditions.elementToBeClickable(By.id("u_0_n")));

        String expectedTitle = "Facebook - Log In or Sign Up";

        assertEquals(expectedTitle,driver.getTitle());

        driver.quit();
    }
}

Solution

  • Try it with the new ChromeDriver exe (2.26). Download here. You can see in the notes that 2.25 suppose to support Chrome 55 but there were bug fixes so try the latest.