Apologies if this is a dumb question - I\'m new to Selenium.
I have a web page I\'m testing that has a few hypertext links in a table. The HTML looks like this:
Notice that the expression in question
driver.findElement(By.xpath("//div[@id='content']/div/form/div/table[2]/tbody/tr/td[1]")).click()
selects a td element, in case of which no link or event is defined. While clicking it in browser should open a link, it will happen only because you're effectively clicking what's inside the tag as well as the td itself. The code above only clicks the td, ignoring its content.
You have to go one step deeper, to the a element within your currently selected td. Like this:
driver.findElement(By.xpath("//div[@id='content']/div/form/div/table[2]/tbody/tr/td[1]/a")).click()