Here is the Selenium RC code for selenium.GetSelectedLabel in Webdriver. This code is in Visual Studio C#
public string GetSelectedLabel(string xpath)
{
string text = "";
if (driver.FindElement(By.XPath(xpath)).Selected)
{
text = GetText(xpath + "/option[@selected]");
}
return text;
}
Here is the Selenium RC code for selenium.GetSelectedIndex in Webdriver. This code is in Visual Studio C#
public string GetSelectedIndex(string xpath)
{
string text="";
int statenum = Convert.ToInt32(GetXpathCount(xpath+"/option"));
for (int i = 1; i < statenum; i++)
{
if (IsElementPresent(xpath+"/option[" + i + "][@selected]"))
{
text = Convert.ToString((i - 1));
}
}
return text;
}
Here is the Selenium RC code for selenium.SelectedLabel in Webdriver. This code is in Visual Studio C#
public string SelectedLabel(string xpath)
{
string text = "";
if (IsElementPresent(xpath))
{
text = GetValue(xpath + "/following-sibling::label");
}
return text;
}
Here is the Selenium RC code for selenium.Uncheck in Webdriver. This code is in Visual Studio C#
public void Uncheck(string xpath)
{
if (driver.FindElement(By.XPath(xpath)).Selected)
{
driver.FindElement(By.XPath(xpath)).Click();
Here is the Selenium RC code for selenium.Check in Webdriver. This code is in Visual Studio C#
public void Check(string xpath)
{
if (!driver.FindElement(By.XPath(xpath)).Selected)
{
driver.FindElement(By.XPath(xpath)).Click();
Here is the Selenium RC code for selenium.SelectWindow in Webdriver. This code is in Visual Studio C#
public void SelectWindow(string Text)
{
driver.SwitchTo().Window(Text);
}