Archive | Selenium RSS feed for this section

Some links for intergrating Jenkins for Selenium

26 Aug

They are so useful


Unit Testing and Test Automation in VS2012 Part 2: Integrating Selenium with Visual Studio

4 Jul

In the first part of this series we discussed about integrating NUnit with Visual Studio 2012. One of NUnit’s strong points is its extensibility which has been used to expand unit testing even further — as far up as the user interface in fact. This is where Selenium comes in.

Selenium runs on top of NUnit so that it can run tests against instances of web browsers. With the new testing features of Visual Studio 2012 we can now use it to test web applications.

If you haven’t read the first part of this series and haven’t followed the steps given there, I suggest reading it now and following the steps to install NUnit on Visual Studio 2012 first. They are a prerequisite to the next steps in this article.

Integating Selenium into Visual Studio 2012

Since we’ve already integrated NUnit to our Visual Studio solution, why not go all the way and use Selenium as well? Selenium uses the NUnit Framework for its tests anyway — it’s just a matter of adding several more components to allow Selenium’s Webdriver to fire up a web browser and start executing tests.

To do this we need to extend our project a bit:

  1. Open up the Manage NuGet Packages window again (right-click on References under the project -> Manage NuGet Packages) and in the search box type “Selenium”
  2. Select “Selenium Webdriver” and click Install to add Selenium references to your project.
  3. Select “Selenium Webdriver Support Classes” and click Install — these are some additional references necessary to run Selenium tests in your Visual Studio solution.
  4. Download IE Webdriver from the Selenium download page (choose the appropriate 32 or 64 bit version) and unzip.
  5. Righ-click on the project name and click “Add existing item…”
  6. Browse to the folder containing IEDriverServer.exe and choose that file to add to the project
  7. Under the project tree right-click on the file and click Properties
  8. Set the value of the field “Copy to Output Directory” to “Copy if newer”

The steps regarding the web driver ensure that the exe required to open up a browser is always copied to the /bin/Debug folder, from where it will in turn be used to call on the browser executables and open up the browser.

We can use the project we already set up above to test this. Add a new class and set it to have the following code. Note the additional OpenQA using declarations, aside from the NUnit.Framework that we’ve used before:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.IE;
using OpenQA.Selenium.Support.UI;
namespace TestAutomation
    public class Driver
        IWebDriver driver;
        public void Setup()
            // Create a new instance of the Firefox driver
            driver = new InternetExplorerDriver();
        public void Teardown()
        public void GoogleSearch()
            //Navigate to the site
            // Find the text input element by its name
            IWebElement query = driver.FindElement(By.Name("q"));
            // Enter something to search for
            // Now submit the form
            // Google's search is rendered dynamically with JavaScript.
            // Wait for the page to load, timeout after 5 seconds
            WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(5));
            wait.Until((d) => { return d.Title.StartsWith("selenium"); });
            //Check that the Title is what we are expecting
            Assert.AreEqual("selenium - Google Search", driver.Title);

Run the tests again. The test should open Internet Explorer and then open up Google. The result in the Test Explorer would look like this, just like our NUnit test:


With the capability to tightly integrate NUnit and Selenium in Visual Studio 2012 solutions and projects, Microsoft redeems itself by rectifying the ghosts of MSTest: it brings unit testing much closer to coding, it finally allows test-first/test driven development, and it opens up the capability for third-party unit testing frameworks to run in Visual Studio as first class citizens. This allows other open source testing frameworks like, QUnit/Jasmine, and MbUnit to run seamlessly with Visual Studio 2012.


I’d like to point out Anoop Shetty’s blog post on Selenium integration from which I took the steps and code for the Selenium test used in this post. While his post was applicable to Visual Studio 2010 the steps were practically the same for Visual Studio 2012.

how to set up an environment and test Android application using Selenium

19 Jun

Android WebDriver allows to run automated end-to-end tests that ensure your site works correctly when viewed from the Android browser. Android WebDriver supports all core WebDriver APIs, and in addition to that it supports mobile spacific and HTML5 APIs. Android WebDriver models many user interactions such as finger taps, flicks, finger scrolls and long presses. It can rotate the display and interact with HTML5 features such as local storage, session storage and application cache.

We try to stay as close as possible to what the user interaction with the browser is. To do so, Android WebDriver runs the tests against a WebView (rendering component used by the Android browser) configured like the Android browser. To interact with the page Android WebDriver uses native touch and key events. To query the DOM, it uses the JavaScript Atoms libraries.

This link is good to learn how to setup and test Android app using Selenium

[Selenium Tutorial] Selenium Grid Overview

3 Dec

This slide will provide for us overview about selenium grid basically

– What is Grid?
– What is Grid Computing
– Selenium Grid
– Selenium Grid Architecture

I got this from Internet

Copyright by Kangeyan Passoubady (Kangs)
Link download: Link

[Slide] Selenium Tutorial – How to Install Selenium RC – step by step

6 Jul

This document will help you to setup Selenium RC

– JRE 1.5 or later
– Selenium RC Server
– Ruby Selenium Client
– Try to run an example with Ruby Test

(Source from Internet)

You can download in link
There are more slides about Selenium Tutorial, I will upload later.

Hold a small tutorial group to learn Selenium

21 Jun

Hello everyone,

I am beginner in investigating about Selenium, so I’d like to hold a small group with everyone who likes to investigate Selenium like me or who had already experience with Selenium and want to share your knowledge. If you are interested in, please register by commenting in here or sending email to me with information as below
– Your name
– Your email
– Your experience about Selenium
– How many hours can you spend to investigate about Selenium per a week?

What you can get after we finish this investigation,
1. Learn how to work with a team and learn by yourself
2. Learn how to make presentation, write guideline in English
3. Get knowledge about Selenium in short time
4. Have new friends around the world

Let’s join together ^^

I expect our project will start from the beginning of July 2012 and ending about Nov 2012 depends on the number of registered persons. I will share detail plan after receiving your registration. Hope that we can cooperate to share knowledge about Selenium together.

Learn to share and share to know more ^^

How to write effective GUI test automation code using Selenium and Java

12 Jun

Just searching on Internet and got this document. In this presentation, you can get some useful information about how to write effective GUI test automation code using Selenium and Java

1. Introduction: What’s Selenium
2. What we achieved
3. 7 good practices using Capture Replay Tools

– GUI element repository.

– Division of data and script.
– Model the test objects.
– Establish standard functions and methods using “speaking” names.
– Central management of environment information.
– Divide common from project specific stuff. Use layering.
– Generate a useful test report
4. What’s missing in Selenium and how we closed the gap
5. Forecast

You can download in link

[Slide] Tutorial document about advanced Selenium

9 Jun

What This Session Covers
1. Selenium’s scope
2. TestRunner techniques
3. Remote Control
4. Ajax
5. IDE
6. Extensions
7. Best practices

This document is so useful if you want to learn detail about Selenium.

Source from
You can download in link

[Slide] Automated Web Testing with Selenium for beginners

6 Jun

You can find useful information for this presentation.

1. What is Selenium?

– Test tool for web applications
– Runs in any mainstream browser
– Supports tests in many languages
– Selenese (pure HTML, no backend required)
– Java, C#, Perl, Python, Ruby
– Record/playback (Selenium IDE)
– Open Source with corporate backing
– Lives at

2. Demo

– Record a test in Selenium IDE
– Show same test written in Java

You can download in link

Source from Erik Doernenburg, ThoughtWorks

List of ebooks about selenium you should read

5 Jun

1. Selenium 1.0 Testing Tools: Beginners Guide

The Selenium Testing Tools Beginner’s guide shows developers and testers how to create automated tests using a browser. You’ll be able to create tests using Selenium IDE, Selenium Remote Control and Selenium 2 as well. A chapter is completely dedicated to Selenium 2. We will then see how our tests use element locators such as css, xpath, DOM to find elements on the page.

Once all the tests have been created we will have a look at how we can speed up the execution of our tests using Selenium Grid.

A beginner’s guide to writing Selenium tests using different aspects of the Framework to give you confidence in your web application

Test your web applications with multiple browsers using the Selenium Framework to ensure the quality of web applications

2.  The 2nd edition of “Selenium Simplified

“Selenium Simplified” takes you through the process of installing and learning to use all the basic tools needed to write automated tests using Java as the programming language. Written in a tutorial style, this book helps you learn to code even if you haven’t programmed before. No time is wasted on the theory of automation or padding about the tools. This book focuses on the practical knowledge needed to automate tests for production systems.After reading this book you will be able to: -Write tests in Java – even if you haven’t coded before reading this book-Install and maintain all the free development and testing tools covered within: Eclipse, JUnit, Selenium, Hudson, Subversion, Xpather, Selenium-IDE-Write automated tests scripts using Java and Selenium-RC-Create abstraction layers to make your automated tests maintainable and readable-Run your automated tests under continuous integration-Use multiple browsers to execute your tests-Understand the most utilised commands in the Selenium API-Test Ajax based web applications-Use Xpath and CSS Selectors in your tests-Understand how to optimise and refactor your tests-Use JUnit for data driven testing.

3. Java Power Tools

All true craftsmen need the best tools to do their finest work, and programmers are no different. Java Power Tools delivers 30 open source tools designed to improve the development practices of Java developers in any size team or organization. Each chapter includes a series of short articles about one particular tool — whether it’s for build systems, version control, or other aspects of the development process — giving you the equivalent of 30 short reference books in one package. No matter which development method your team chooses, whether it’s Agile, RUP, XP, SCRUM, or one of many others available, Java Power Tools provides practical techniques and tools to help you optimize the process. The book discusses key Java development problem areas and best practices, and focuses on open source tools that can help increase productivity in each area of the development cycle, including: Build tools including Ant and Maven 2 Version control tools such as CVS and Subversion, the two most prominent open source tools Quality metrics tools that measure different aspects of code quality, including CheckStyle, PMD, FindBugs and Jupiter Technical documentation tools that can help you generate good technical documentation without spending too much effort writing and maintaining it Unit Testing tools including JUnit 4, TestNG, and the open source coverage tool Cobertura Integration, Load and Performance Testing to integrate performance tests into unit tests, load-test your application, and automatically test web services, Swing interfaces and web interfaces Issue management tools including Bugzilla and Trac Continuous Integration tools such as Continuum, Cruise Control, LuntBuild and Hudson If you area Java developer, these tools can help improve your development practices, and make your life easier in the process. Lead developers, software architects and people interested in the wider picture will be able to gather from these pages some useful ideas about improving your project infrastructure and best practices.