Automation Tips

The constructor DefaultSelenium(String, String, String, String) is undefined 

I was creating a script in Java and wanted to run the script using TestNG and Eclipse. I was getting the following error when running the script.
The constructor DefaultSelenium(String, String, String, String) is undefined
To solve the issue you will have to make change to the setUp method.
My code was something like this selenium = new DefaultSelenium(“localhost”, “4444″, “*iexplore”, “http://www.google.com/”); having 4444 as a string. I then changed the code to selenium = new DefaultSelenium(“localhost”, 4444, “*iexplore”, “http://www.google.com/”);

By Pavandeep Puddupakkam on December 7, 2010 | Automation Tips, Selenium RC | 3 comments
Tags: , ,

Selenium function for click 

Here is selenium function that you can use when you want to either click on a button or link. I have foud this code very useful and interesting.

public void clickElement(String object, String wait) {
String locator = getValue(object);
if (selenium.IsElementPresent(locator))
{
selenium.Click(locator);
Console.WriteLine("Clicked on " + object);
}
else
{
Console.WriteLine(object + " was not found");
}
waitForPageToLoad(wait);
}

You can write this function in a seperate functions class and then call this function in your test script class by referencing the functions class.

More…

By Pavandeep Puddupakkam on December 1, 2010 | Automation Tips, Selenium RC | 5 comments

How to use contains to get the attribute value in xpath 

This is one my best finds so far and would like to share it with you. Here is an example that shows you how to use the xpath contains to build a xpath using part of the attribute value. This can be used when there are elements with the same id or text value.

More…

By Pavandeep Puddupakkam on November 19, 2010 | XPath | 5 comments
Tags:

How to disable add-ons pop-up for Custom firefox profile 

Here is the way to disable add-ons window which appears every time when selenium scripts are run on Custom Firefox Profile.

More…

By Pavandeep Puddupakkam on September 16, 2010 | Automation Tips | 6 comments
Tags: ,

Alternative to using xpath contains text() in Selenium 

Here is an alternative to using contains text() in xpath command

script type="text/javascript"
try {
var pageTracker = _gat._getTracker("UA-222222-3");
pageTracker._trackPageview();
} catch(err) {}script

More…

By Pavandeep Puddupakkam on September 15, 2010 | Selenium RC, XPath | 2 comments
Tags: , ,

Solving CMD does not support UNC paths 

Here is an example of how you can solve the issue relating to getting access to the share drive folder from your command prompt:
pushd \\Testing\Selenium_Tests\SeleniumSoftware\selenium-remote-control-1.0.1\selenium-server-1.0.1
The solution is to use pushd instead of cd to change the current directory to a share accessed via a UNC path

By Pavandeep Puddupakkam on September 14, 2010 | Automation Tips | A comment?
Tags: