Q:

Using selenium to click on a text link

I am able to click on the link using selenium but it opens a new tab for me ,instead of opening in the same tab , and it just shows data; in the address bar and not content in the page.
public class InternetExplorerDriverTest {
 public static void clickLinkByHref(String href) {
    WebDriver driver = new ChromeDriver();
    List<WebElement> anchors = driver.findElements(By.tagName("a"));
    Iterator<WebElement> i = anchors.iterator();

    while(i.hasNext()) {
        WebElement anchor = i.next();
     if(anchor.getAttribute("href").contains(href)) {

         anchor.click();
         break;
        }
    }
}

public static void main(String[] args) {
WebDriver driver = new ChromeDriver();
 driver.get("https://url");
 driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
WebElement element =       

driver.findElement(By.id("323bb07bc611227a018aea9eb8f3b35e"));
 element.click();

 clickLinkByHref("ea7d96126f92a100f3ae60526e3ee4e0");

}
}
The console in the eclipse shows below 'after 2 minutes'
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: crashed
  (Driver info: chromedriver=2.25.426923 (0390b88869384d6eb0d5d09729679f934aab9eed),platform=Windows NT 6.1.7601 SP1 x86) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 61.87 seconds
Build info: version: '2.39.0', revision: 'ff23eac', time: '2013-12-16 16:12:12'
System info: host: 'NLLR4000290859', ip: '10.29.137.219', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_31'
Driver info: org.openqa.selenium.chrome.ChromeDriver
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:216)
    at org.openqa.selenium.chrome.ChromeDriver.startSession(ChromeDriver.java:182)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:111)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:115)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:161)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:150)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:107)
    at InternetExplorerDriverTest.clickLinkByHref(InternetExplorerDriverTest.java:41)
    at InternetExplorerDriverTest.main(InternetExplorerDriverTest.java:94)

A:

driver.switchTo().frame(driver.findElement(By.id("gsft_main")));

The above code line was required to switch to the iframe . This works now.

