Q:

Selenium: Element could not be scrolled into view

I am trying to learn Selenium using java with Eclipse. I am trying to locate one element in the webpage. 
I tried using this line of code to click on one html <a> element:    
driver.findElement(By.xpath("//a[@href='itemDetail.php?id=19']")).click();

The picture below shows the html structure of the page:

With that piece of code, I ran into an exception: 

Element <a href="itemDetail.php?id=19"> could not be scrolled into
  view

Did I use the wrong syntax to locate the element?
Thank you for the advice. 

A:

The locator looks good as you haven't received NoSuchElement exception. Try the below javascript click, which does not need the element to be scrolled into view.
JavaScript Click
WebElement element = driver.findElement(By.xpath("//a[@href='itemDetail.php?id=19']"));
JavascriptExecutor js = (JavascriptExecutor) driver;  
js.executeScript("arguments[0].click();",element);

If you want to scroll the element into view and the do normal click user the below code.
Scrolling into view and normal click:
WebElement element = driver.findElement(By.xpath("//a[@href='itemDetail.php?id=19']"));    
JavascriptExecutor js = (JavascriptExecutor) driver;  
js.executeScript("arguments[0].scrollIntoView();",element);
element.click();

