You can use selenium.IsElementPresent(“element”) to see if a particular element is present on the web page. This is a very powerful function in selenium as you can use it with a if condition.
In this example I am first checking if there is an element //td[@class='Selenium'] on the web page. If yes then I click the element //td[@class='Selenium'] and continue checking the other conditions.
if (selenium.IsElementPresent("//td[@class='Selenium']"))
{
selenium.Click("//td[@class='Selenium']");
selenium.WaitForPageToLoad("30000");
try
{
Assert.IsTrue(selenium.IsElementPresent("//td[@class='Selenium1']"));
}
catch (AssertionException)
{
writefail("Selenium RC is Present");
}
}
else
{
writefail("Selenium RC link does not exist");
}
Submitted by Pavandeep Puddupakkam

What references are you using here?