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 @ seleniumconf.org.

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

[googlemaps https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d2795.628752794783!2d-122.6799365!3d45.517551499999996!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x54950a05364d0003%3A0xfd2dcb4549142c21!2s921+SW+6th+Ave%2C+Portland%2C+OR+97204%2C+USA!5e0!3m2!1sen!2sie!4v1434544334238&w=600&h=450]

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:
[code]
var IE_Options = new InternetExplorerOptions
{
IgnoreZoomLevel = true,
EnableNativeEvents = false
};
driver = new InternetExplorerDriver(IE_Options);
[/code]

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 SeleniumHQ.org

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:

browser

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

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

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:

C#
[code]
IWebElement checkbox = driver.FindElement(By.Id(“ElementID”));

if (((RemoteWebDriver)driver).Capabilities.BrowserName == “firefox”)
{
// Firefox
checkbox.Click();
}
else
{
// Chrome and IE
checkbox.SendKeys(Keys.Space);
}
[/code]

Java
[code]
WebElement checkbox = driver.findElement(By.id(“idOfTheElement”);

if (driver.Capabilities.BrowserName.Equals(“firefox”))
{
checkbox.Click();
}
else
{
checkbox.SendKeys(Keys.Space);
}

[/code]

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 http://www.w3schools.com/tags/tag_select.asp with an added Id attribute in the <SELECT> tag ):
[code]
<select id=”cartypes”>
<option value=”volvo”>Volvo</option>
<option value=”saab”>Saab</option>
<option value=”mercedes”>Mercedes</option>
<option value=”audi”>Audi</option>
</select>
[/code]
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:
[code]
//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:
selectOption.SelectByText(“Mercedes”);
selectOption.SelectByIndex(2);
selectOption.SelectByValue(“mercedes”);
[/code]

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.

[youtube=https://www.youtube.com/watch?v=ASVqZPN3j7k]

Agenda
01:35 – 9:45 W3C Update
11:23 – 16:00 Selenium 3 Status Update
16:05 – 17:10 Marionette (FirefoxdDiver rewrite) testing help
17:20 – 19:27 ChemistryKit rewrite
17:28 – 20:24 Visual Testing Part 1
20:25 – 23:47 Selenium Guidebook in Java!
23:52 – 29:51 Visual Testing Part 2

For More details see the Official Selenium Blog