Using selenium.GetAttribute in Webdriver

Here is the Selenium RC code for selenium.GetAttribute in Webdriver. This code is in Visual Studio C#

public string GetAttribute(string xpath, string attribut)
{
string value = "";
if (IsElementPresent(xpath))
{
value = driver.FindElement(By.XPath(xpath)).GetAttribute(attribut);
}
return value;
}


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>