WebDriver

Using selenium.Uncheck in Webdriver 

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();

More...

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

Using selenium.Check in Webdriver 

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();

More...

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

Using selenium.SelectWindow in Webdriver 

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

Using selenium.SelectFrame in Webdriver 

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

public void SelectFrame(string xpath)
{
driver.SwitchTo().Frame(xpath);
}

Using selenium.DeleteAllVisibleCookies in Webdriver 

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

public void DeleteAllVisibleCookies()
{
driver.Manage().Cookies.DeleteAllCookies();
}

Using selenium.waitForElementPresent in Webdriver 

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

public bool waitForElementPresent(string Xpath)
{
bool present = false;
for (int second = 0; ; second++)
{
if (second >= 5)
{
break;
}
if (IsElementPresent(Xpath))
{
present = true;
break;
}
Thread.Sleep(1000);
}
return present;
}