Selenium RC

Using Selenium in a Ajax web application 

On an Ajax web application or Ajax feature on web page small sections of the page will update and often the entire webpage will not load. It’s necessary to wait until this ajax process is completed before interacting with sections of the page where content or controls are yet to be rendered.


Validating the text from a text box using Selenium RC 

Here is the html code input id=”qu” and the text in the text input box is Selenium Wiki.

To validate the text from a text box using Selenium RC you will have to use the Selenium command selenium.getValue(). This will get the value in the location input id=”qu”.


By Pavandeep Puddupakkam on September 8, 2011 | Selenium RC, XPath | 2 comments
Tags: , ,

Handling IE Security Warning in Selenium RC 

When I was running the Selenium RC scripts on IE browser I was getting a Security Warning popup box. Because of this the script was not running and the tests failed.


By Pavandeep Puddupakkam on September 7, 2011 | Selenium RC | 2 comments
Tags: , ,

Comparing Dates in C# , selenium RC 

Example to convert string to date time variable and also compare two date time variable.
string Firstdate = selenium.GetText(FirstDate_xp);
string Nextdate = selenium.GetText(Nextdate_xp);
DateTime date1 = Convert.ToDateTime(Firstdate);
DateTime date2 = Convert.ToDateTime(Nextdate);
int result = DateTime.Compare(date1, date2);
//Compare function returns
//0 if both dates are equal
//1 if date1 is recent than date2
//-1 if date2 is recent than date1

If you found this solution helpful or have something extra to add, feel free to share it here by commenting below.

By Rashmi on September 2, 2011 | Selenium RC, Visual Studio 2010 | 2 comments
Tags: ,

Convert from Integer to String – Selenium 

Here is the Selenium example code that uses Integer.toString in Selenium.Type command
int i = 1000;
while(i != 999999){
selenium.type("id=resetKey" , Integer.toString(i) );"id=button");
i = i + 1 ;

By Pavandeep Puddupakkam on | Selenium RC | A comment?
Tags: , ,

Selenium RC Test Framework using XML Data structure 

In this example I will explain you how to create a Selenium RC test framework and have the test data including the xpaths in a XML data file. The scripts mentioned under are as following:
1. ObjectRef.cs file that has the test data and the xpaths defined, the code to read the XML Data file
2. FunctionReference.cs that has the TestInitialize and TestCleanup. The Test Data and Xpaths are in Data.xml.
3. Two test methods Google_AU and Google_US scripts (Google Search) – Google_AUTest.cs and Google_USTest.cs
Add System.Xml.dll to the reference library.