I tried these(in scenario when the element does not exist) and always getting
OpenQA.Selenium.NoSuchElementException
If driver.FindElement(By.XPath("//input[@id='username']")).Displayed = True Then
driver.FindElement(By.XPath("//input[@id='username']")).Click()
End If
If driver.FindElement(By.XPath("//input[@id='username']")) = True Then
driver.FindElement(By.XPath("//input[@id='username']")).Click()
If driver.FindElement(By.XPath("//input[@id='username']")).Displayed Then
driver.FindElement(By.XPath("//input[@id='username']")).Click()