selenium.GetAttribute

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 text = "";
if (IsElementPresent(xpath))
{
text = driver.FindElement(By.XPath(xpath)).GetAttribute("href");
}
return text;
}

By Pavandeep Puddupakkam on December 14, 2011 | WebDriver | A comment?
Tags: , ,

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;
}

By Pavandeep Puddupakkam on December 9, 2011 | Selenium RC, WebDriver | A comment?
Tags: , ,