Sometimes it is not always possible to uniquely identify an element by using the standard ways such as By.ID or By.Name etc. And there can be any number of reasons why this would be the case. However there is an alternative way to find an element by using one of the element’s attributes:
driver.FindElement(By.CssSelector(“[title=’Unique Identifier’]”));

This example will find the element that has “Unique Identifier” as the value for its title attribute. Using the CSS Selector is an elegant way to find this element, but there are other ways to achieve the same outcome. Using XPath you can achieve the same outcome as per this example:
driver.FindElement(By.XPath(“//*[@title=’Unique Identifier’]”));

However I find that this XPath solution is not as readable as the previous CSS Selector version. There is a plus however to using XPath as we can fine tune the search. The //* part of the XPath indicates that we are to search ALL HTML tags for the specified title. But if you change the //* and replace the asterix with the name of an HTML tag such as img then we can search for only <img> elements that have the specified title.
driver.FindElement(By.XPath(“//img[@title=’Unique Identifier’]”));

If you come across any similar solutions, add them to the comments below.

The Selenium Conf 2015 is happening September 8-10 in Portland, Oregon and there are a limited number of early bird tickets available on sale now. For further details see the Selenium Conf 2015 website @

The venue for the conference is
Hilton Portland & Executive Tower
921 SW 6th Ave, Portland, OR 97204
(503) 226-1611


You can register online here.
You can submit a talk here.

Many times I have kicked off an automated test using InternetExplorerDriver() only for it to crash straight away as the zoom was not set to 100%. (Why is this required, it makes no sense to me). Internet ExplorerPreviously the only way I could get around this was to open a new window of Internet Explorer, reset the zoom to 100%, close the browser, reopen the browser again to verify the correct zoom. While this worked it wasn’t a very elegant solution.

Finally I found how to ignore the zoom level requirement and it is as simple as this when starting up your browser:
var IE_Options = new InternetExplorerOptions
IgnoreZoomLevel = true,
EnableNativeEvents = false
driver = new InternetExplorerDriver(IE_Options);

This allows you to run your test without having to worry about what the zoom is currently set to.

Here are the release notes from the Selenium 2.45 .Net bindings, which were not available online at the time of the release

  • Supports native events for Firefox versions 31 (current ESR), and 24 (immediately previous ESR). Native event support has been discontinued for versions of Firefox later than 33
  • Removed automatic installation of SafariDriver extention for .NET. From this point forward, users are expected to manually install the SafariDriver extension into their Safari installation in order to drive the browser. This is due to Apple’s changes in architecture for Safari extensions.
  • Added initial implementation of .NET bindings OperaDriver. The .NET bindings will now support the Chromium-based Opera driver without requiring the use of the Java remote WebDriver server. This driver will work with Opera 26 and above, and requires the download of the Opera driver executable. Code cleanup and refactoring will take place under a separate commit. Note that there is still no support in the .NET bindings for the Presto-based Opera without using the remote server, nor is there likely to be.
  • Added option to not delete anonymous Firefox profile in .NET. This change adds an option to the .NET FirefoxProfile class so that the driver will not delete the anonymous profile created by the driver. Since the driver cannot and should not use an existing profile in situ because of the multiple instance automation case, this change means that modifications applied to the anonymous profile can be retained and used in future anonymous profiles. The implication is that the user can now make modifications to a profile, and retain those profile modifications (e.g., cookies) into other future profiles, simulating persistent changes over multiple browser launches. Fixes issue #7374.
  • Introduced type safe option in InternetExplorerOptions to set the capability to disable check of mime type of the document when setting cookies. When setting cookies, there is a check in the IE driver to validate that the page in the browser is, in fact, an HTML page. Despite the fact that omitting this check can cause unrecoverable crashes in the driver, there is demand for a mechanism to disable this check for older, legacy versions of Internet Explorer. Fixes issue #1227.

Don’t forget you can download Selenium from

While not a major requirement getting the browser name and version could come in useful in test reports. Use the following code snippet to get the browser name and version:


ICapabilities cap = ((RemoteWebDriver)driver).Capabilities;
string strBrowserName = cap.BrowserName;
string strBrowserVersion = cap.Version;

Console.WriteLine(“Testing on Browser {0} v{1}”, strBrowserName, strBrowserVersion);

For something as simple as checking a checkbox you would think that all the different browser drivers would implement this in the same way. But sadly this is not the case. Firefox expects that you click on a checkbox to check or uncheck it whereas both the IEDriver and ChromeDriver expect you to type a space to do the same. This is all well and good for running a simple once off test, but we cant be expected to change code and re-build every time we want to test in a different browser.

Thankfully there is a solution at hand. Once we know which browser is currently running the test, we can decide which method to use. I have provided a C# and a Java code snippet below:

IWebElement checkbox = driver.FindElement(By.Id(“ElementID”));

if (((RemoteWebDriver)driver).Capabilities.BrowserName == “firefox”)
// Firefox
// Chrome and IE

WebElement checkbox = driver.findElement(“idOfTheElement”);

if (driver.Capabilities.BrowserName.Equals(“firefox”))


If you come across any other discrepancies between the different driver implementations let us know in the comments.

This example uses C# language to illustrate the point, I will provide a Java version at a later stage.
To use drop down selects in WebDriver you have to define the SELECT object as well as the OPTION object. This may be due to the way these are coded in HTML (This example is taken from with an added Id attribute in the <SELECT> tag ):
<select id=”cartypes”>
<option value=”volvo”>Volvo</option>
<option value=”saab”>Saab</option>
<option value=”mercedes”>Mercedes</option>
<option value=”audi”>Audi</option>
So in WebDriver we have to define the SELECT element first, and then using this object we define the OPTION object. Once we have out option item defined we can select it by using the displayed text, its index or its value. There are separate methods for each of these; SelectByText(), SelectByIndex() and SelectByValue() respectively. Each of the the SelectBy examples below are selecting the same item “Mercedes” in the car types drop down list:
//SELECT element defined
var ddlCarTypes = driver.FindElement(By.Id(“cartypes”));

// OPTION element defined in the car types drop down list
var selectOption = new SelectElement(ddlCarTypes);

// Select the same item in the list using Text, Index or Value:

Software Testing Magazine – Testing Circus December 2014 Edition is out. This is the 51st edition of this software testing magazine. Download a free copy of Testing Circus December 2014 Edition, read, share with testers.

Some awesome stories in this edition:

  • Interview with Anna Royzman by Srinivas Kadiyala
  • Four Simple Steps to Becoming the Best Tester – Mike Talks
  • Mobile Testing: How Do I Start to Learn? – Jean Ann Harrison
  • Assumptions in Testing – Jyothi Rangaiah
  • Five Lessons for Effective Communications – Raj Subramanian
  • Unfolding of A/B Testing – Venkat Ramesh Atigadda
  • Taking Care of Critical Bugs in Prior to Production Launch – Ravi Kumar BN
  • Testing Events Around the World
  • Tester’s Astrology 2015
  • Book Worm’s Corner
  • A Fake Tester’s Diary by Fake Software Tester
  • Testers to Follow
  • Learn programming to build a strong report – Santhosh Tuppad
  • Blazemeter Version 3.0 Supports Selenium Testing
  • NeoSense Enables Synthetic Monitoring
  • MobileCloud Customers Can Use Jenkins Plugin

Click here to download your free December 2014 Edition of Testing Circus.