Using regular expression in Selenium

Here is the xpath I want to use regular expression.
Code with out using regular expression:
Code using regular expression:

Alternative is to use contains in the xpath. Here is the example:

Selenium RC Error – SeleniumException: XHR ERROR

When running the selenium script of a website I got the following error
com.thoughtworks.selenium.SeleniumException: XHR ERROR: URL = Response_Code = 400 Error_Message = Bad Request.
The solution was pretty simple. Instead of using the url change it to Remove the www.
The reason オンライン カジノ is because there is no 301 re-direct is not setup for the website.
Originally the setup was – setUp(“”, “*chrome”);
Changed it to – setUp(“”, “*chrome”);

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”, “”); having 4444 as a string. I then changed the code to selenium = new DefaultSelenium(“localhost”, 4444, “*iexplore”, “”);

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))
Console.WriteLine("Clicked on " + object);
Console.WriteLine(object + " was not found");

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.

How did this solution work for you? Do you have a better alternative? Feel free to share your thoughts in comments section below.