Trying to find link element of "a href". Snippet code:
<div id="contact-link">
<a href="http://automationpractice.com/index.php?controller=contact" title="Contact Us">Contact us</a>
</div>
I managed doing it by:
Driver.FindElement(By.XPath("//*[@title='Contact Us']")).Click();
2.Driver.FindElement(By.XPath("//a[@href='http://automationpractice.com/index.php?controller=contact']")).Click();
3.Driver.FindElement(By.XPath("//*[text()='Contact us']")).Click();
Could someone tell me how can I get by firstly getting parent div and then find what's inside that div (by going from the top to the bottom)