In reply to your first question: If you are using Selenium/Webdriver you can use the WebDriverWait class (see this: https://sqa.stackexchange.com/questions/160/how-do-you-wait-for-jquery-ajax-calls-to-complete-in-selenium-2/166#166) or you could use `driver.FindElements(..)` as it does not throw if no elements are found. You can then use some linq magic to get the first match. So it would look something like this: `driver.FindElements(..).FirstOrDefault()`.