Selenium 2

verifyTextPresent in Python Selenium 2 Webdriver 

Here is an example for Python.
def is_text_present (self, string):
if str(string) in self.driver.page_source: return True
else: return False


By Pavandeep Puddupakkam on September 7, 2011 | Python, WebDriver | 1 comment
Tags: , , ,

StaleElementReferenceException resolved with Selenium 2.5.1 drivers 

The issue relating to StaleElementReferenceException when trying to use Selenium 2 SelectByText – selectElementEntity.SelectByText() is resolved in the latest version of Selenium Client Driver – Selenium 2.5.1 drivers (.NET bindings for Selenium, including the RC and WebDriver APIs)

Using verifyTextPresent in Selenium 2 Webdriver 

There is no verifyTextPresent in Selenium 2 Webdriver; I have created a function that you use to verify if a particular text is present on a web page. You can change the name of the function to anything you want.
public void verifyTextPresent(String value)
driver.PageSource.Contains(value); ;


By Pavandeep Puddupakkam on July 12, 2011 | WebDriver | 9 comments
Tags: , , ,

Creating getText function for Selenium 2 in C Sharp 

As most of you know there is no getText() function in Selenium 2 C#; I have created a function that you can use to get the text associated with a element/xpath.

public String getText(String xpath)
String x = driver.FindElement(By.XPath(xpath)).Text;
return x;

Here is how I have used the getText() function in my test script:
Printing the text assoicated with the xpath “//div[@id='fll']/a[1]“

Selenium 2 Webdriver C Sharp example 

As most of you already know there is a new version of Selenium – Selenium 2 that was released today I have created a new script that you can use to start off using Selenium 2 in C#.
What I have seen is that we dont have to use webdriver.firefoxdriver.dll to run your scripts in Webdriver Selenium 2.
I have given the test script and also a screenshot that shows you the dll files that I have included as Reference


What is Selenium WebDriver 

WebDriver uses a different underlying framework from Selenium’s javascript Selenium-Core. It also provides an alternative API with functionality not supported in Selenium-RC. WebDriver does not depend on a javascript core embedded within the browser, therefore it is able to avoid some long-running
Selenium limitations.
WebDriver’s goal is to provide an API that establishes
• A well-designed standard programming interface for web-app testing.
• Improved consistency between browsers.
• Additional functionality addressing testing problems not well-supported in Selenium 1.0.
The Selenium developers strive to continuously improve Selenium. Integrating WebDriver is another step in that process. The developers of Selenium and of WebDriver felt they could make significant gains for the Open Source test automation community be combining forces and merging their ideas and
technologies. Integrating WebDriver into Selenium is the current result of those efforts.

By Pavandeep Puddupakkam on September 17, 2010 | Selenium RC, Software Testing | A comment?
Tags: , ,