Selenium and TFS

Overview

Problem: How can we test our web site? One option is to use http://seleniumhq.org/.

The Firefox plug-in “Selenium IDE” can be used to record, edit and manage scripts. (See their site for details)

We have then taken this further by creating a c# test project and adding the html test scripts into source control. On a nightly/on demand bases we run selenium tests, as if they we’re ms unit tests through TFS.

This process opens the html test suites/cases and sends the commands to a selected Selenium RC server, recording the results in a SQL database.

A Dynamic Data ASP.Net site lets people view the progress of a TestRun with screenshots when an action fails.

 

Components

Selenium IDE

(Requires Firefox) The Selenium IDE can be used to record Test Cases and link them via a Test Suite. By default, they are stored as HTML. This is the main tool the tester will use to edit, manage and run the test cases.

Selenium RC

The “Remote Control” Java application that is used to interact with a browser based on commands it receives. This should be run on the target OS in a VM.

TestEase

TestEase uses the test cases in a Test Project and sends the commands to the selenium RC. Results are stored in a database.

Build integration

As the tests run as standard C# they can be added as unit tests and then run each night (after a deployment).

Test Ease Site / Reports

A simple web site can be used to display the results from the database. It is even possible to see screenshot when an action fails. Reporting services can be used to pull statistics from the database.

Selenium Grid

If the product under tests needs to support multiple browsers and operating systems, for example a public facing web site, Selenium Grid can be used to run the tests on multiple environments. (this has not been done for our product)

 

Problems

Speed changes the results. Depending on the web site, depending on if a page comes back or if the test timeout. This might be an issue with an ASP.net site because the first time a new deployment is accessed it JIT compiles the code. Workarounds include: 1, increasing the selenium timeout. 2, “Hitting” the site to force the Jitting before running the tests. 3, Force the asp compiler to JIT the site as part of a deployment.

All tests can break if the control names change (unlike UIA accessibility). By default, selenium will normally use the id of the html control as its reference. If the site layout changes this could break the tests. Workarounds:

Testers need to know about VS and source control including merging. (minor issue)

Screenshot don’t work when using Remote desktop. The VM host view must be used instead.

Selenium RC isn’t a service. Workaround: Auto login/start the RC in case the server is reset.

Firefox isn’t currently working on the RC box due to a profile issue.

Some commands in the IDE are not available in the RC (e.g. echo, pause). TestEase manages these manually.

Ajax requires “pauses” that might not be that robust

Popups can be an issue if the windows aren’t name. The RC supports multi-window that can help when testing a multiple window web site

 

Future Improvements

Requirement mapping. It would be nice to see the requirements for the system and how many tests cover them. It is thought that an echo or new selenium command can be used to show what requirement the test is covering.

Better configuration management. Some more work needs to be done to the configuration of the c# project. For example, pushing the settings to xml files or to build properties. This will be useful if the tester wants to run the tests on a different set of servers.

Remove the database dependency so that the tests can be run ad-hoc.

Add data driven testing. This could be achieved by using template test files. The templates could contain tokens that are replaced by the TestEase engine. The process could generate test files that can be run by the Selenium IDE with the tokens replaced.

 

Alternatives

Microsoft Visual Studio Web Testing,

Uia (for WinForms)

VSTS 2010 - http://www.microsoft.com/visualstudio/2010/overview.mspx

Comments

# Selenium, TFS and Agile
Gravatar Selenium, TFS and Agile
Left by Rob Lambert's Blog on 1/15/2009 5:11 PM
# re: Selenium and TFS
Gravatar I'm interested in using msbuild and selenium, but I can't find a reference via web search to "TestEase", and am also not sure what exactly it's doing as part of your process. Could you illuminate me?
Left by Pete on 7/29/2009 10:49 PM
# re: Selenium and TFS
Gravatar Funny you should ask...TestEase has been writtern by iMeta to read the Selenium html files and send the actions to a driver. It stores the results with a couple of other nice features. iMeta might release a version soon. Thanks.
Left by Mike Blake on 7/31/2009 2:53 PM
# re: Selenium and TFS
Gravatar Hi,

Can you tell me why you chose to use Selenium with TFS instead of the TFS Webtest tool? We're facing this choice and are looking at TFS 2010 which has not only the webtest automation features but also a new GUI automation tool....

thanks,
Sarah
Left by Sarah on 2/25/2010 2:02 PM
# re: Selenium and TFS
Gravatar My biggest issue with Selenium is the lack of conditional statements. Your website has to be at a pretty good level of completion for Selenium to test it regularly. Yes, I do use the extensions of goto & gotoAndWait(whatever they are called), but still it's a chore to use. I wish I could branch things off easily with Selenese commands to let me jump from one label to another.....
Left by guida casino on 5/4/2010 11:12 AM
# re: Selenium and TFS
Gravatar I wish I could branch things off easily with Selenese commands to let me jump from one label to another
Left by cheap ghd on 5/5/2010 8:56 AM
# re: Selenium and TFS
Gravatar It is good that people are able to get the lowest-rate-loans.com and it opens new chances.
Left by AdaMccullough20 on 5/8/2010 12:02 AM
# re: Selenium and TFS
Gravatar My biggest issue with Selenium is the lack of conditional statements. Your website has to be at a pretty good level of completion for Selenium to test it regularly. Yes, I do use the extensions of goto & gotoAndWait(whatever they are called), but still it's a chore to use. I wish I could branch things off easily with Selenese commands to let me jump from one label to anot
Left by Giocare a poker on 5/8/2010 8:52 AM
# re: Selenium and TFS
Gravatar I'm looking for an information on Selenium, and I found here a lot of it. Nice article and exactly what I need. Most of all I like the style. Great job, thanks.
Left by custom essay writer on 6/16/2010 12:07 PM
# re: Selenium and TFS
Gravatar Hey, Good post about Twitter. I think Twitter is going to be one of the best networks because of the fact that it is supported by so many industries. I also think when Twitter reveals some of it’s new functions, returning traffic will go up to show the real growth of the network. Keep up the good work!
Left by Urine Luck on 6/23/2010 6:26 PM
# re: Selenium and TFS
Gravatar Gravatar Funny you should ask...TestEase has been writtern by iMeta to read the Selenium html files and send the actions to a driver. It stores the results with a couple of other nice features. iMeta might release a version soon. Thanks.
Left by auto insurance quotes on 6/24/2010 7:40 PM
# re: Selenium and TFS
Gravatar I use it as essay example for my article.
Left by essay example on 7/9/2010 12:04 PM
# re: Selenium and TFS
Gravatar I was looking for crucial information on this subject. The information was important as I am about to launch my own portal. Thanks for providing a missing link in my busines
Left by sonnerie portable gratuit on 7/22/2010 8:26 AM
# re: Selenium and TFS
Gravatar thanks for this good information
Left by sonnerie portable gratuit on 7/22/2010 8:27 AM
# re: Selenium and TFS
Gravatar Selenium is a open source web testing tool. You can download it from http://selenium.seleniumhq.org/. It run directly in browser and it is platform independent and can be deployed on Linux, MAC and Windows environment (JavaScript-enabled Web browsers
Left by agile informatics fremont on 7/23/2010 7:57 AM
# re: Selenium and TFS
Gravatar If you are developing web applications for different customer scenarios in which timestamping matters, there is a chance that you will be asked to put a real-time dynamic clock on the page depending on your real estate limitations on the UI. Any search result would give you several remedies to this purpose, but I wanted to have something short, neat and cross-browser compatible.
Left by Free Craps Online on 7/23/2010 8:20 AM
# NFL jerseys
Gravatar You write good articles, I will always be concerned about
Left by NFL jerseys on 7/24/2010 3:11 AM
# re: Selenium and TFS
Gravatar I've been looking for this article, and now I have finally found it. Great article of yours! Keep posting!
Left by Car Accident Solicitor on 8/3/2010 11:38 PM
# re: Selenium and TFS
Gravatar Team Foundation Server works in a three-tier architecture: the client tier, the application tier and the data tier. The client tier is used for creating and managing projects and accessing the items that are stored and managed for a project. TFS does not include any user interface for this tier, rather it exposes web services which client applications can use to integrate TFS functionality with themselves. These web services are used by applications like Visual Studio Team System to use TFS as data storage back end or dedicated TFS management applications like the included Team Foundation Client. The web services are in the application layer. The application layer also includes a web portal and a document repository facilitated by Windows SharePoint Services.
Left by Local seo Uk on 8/6/2010 12:25 PM
# re: Selenium and TFS
Gravatar Most activity in Team Foundation Server revolves around a "work item". Work items are a single unit of work which needs to be completed. In many respects they are similar to a "bug" item in bug tracking systems such as Bugzilla, in that a work item has fields to define Area, Iteration, Assignee, Reported By, a history, file attachments, and any number of other attributes. Work items themselves can be of several different types, such as a Bug, a Task, a Quality of Service Assessment, a Scenario, and so forth. The framework chosen for any given project in a Team Foundation Server defines what types of work items are available and what attributes each type of work item contains. These items are internally stored in XML format, and their schema can be customized to add other attributes to different items, or create new items on a per-project basis. Each work item has associated control policies which control who is allowed to access and/or change the items. It also includes notification and logging capabilities to log all the creation, access or change events (controlled by policies) and optionally notify certain users when certain events occur.
Left by staffing company on 8/6/2010 12:28 PM
# re: Selenium and TFS
Gravatar TFS does not natively include a UI for performing these tasks. The capabilities are exposed via web services, which are then used by client applications like Visual Studio Team System IDE. However, TFS does include a Team Foundation Client (TFC) application which can be used to perform these tasks outside of the VSTS IDE. TFC also operates by invoking the same web services. TFS exposes a client API that can be used by client applications to access the functionality; the API itself manages proxies to communicate with the web services as well as client side caching to reduce latency. The WSDL descriptions of the web services are also provided, in case an application wants to directly call the web services. Visual Studio Team System Web Access, available as an add-on, also addresses this.
Left by adwords google on 8/6/2010 12:31 PM
# re: Selenium and TFS
Gravatar Travel aide will help you to find best deals on flight tickets, hotel bookings, holiday packages, best travel insurance, cheap car rental information along with affordable package holidays.
Left by Cheap flight on 8/6/2010 12:34 PM
# re: Selenium and TFS
Gravatar team foundation server .. ughhh
Left by Beat Maker Software on 8/13/2010 10:27 PM
# re: Selenium and TFS
Gravatar Selenium is a toxic nonmetallic element related to sulfur and tellurium; occurs in several allotropic forms; a stable grey metallike allotrope conducts electricity better in the light than in the dark and is used in photocells; occurs in sulfide ores (as pyrite)
Left by Workplace accident claim on 8/18/2010 2:16 AM
# re: Selenium and TFS
Gravatar great. thank you .
Left by gucci wallet on 8/18/2010 12:16 PM
# re: Selenium and TFS
Gravatar Selenium is a web testing tool in open source running directly in your browser and platform independent (Linux, MAC and Windows)
Left by Full Tilt Referral Code on 8/20/2010 10:06 PM
# re: Selenium and TFS
Gravatar nice post. ive looking for this for quite a time. great job. keep it up
Left by Car Accident Solicitor on 8/24/2010 12:38 AM
# re: Selenium and TFS
Gravatar Selenium ( ) is a chemical element with the atomic number 34, represented by the chemical symbol Se, an atomic mass of 78.96. It is a nonmetal, chemically related to sulfur and tellurium, and rarely occurs in its elemental state in nature.
Left by Blair Oliver Scott on 8/27/2010 1:57 AM
# re: Selenium and TFS
Gravatar Selenium is a portable software testing framework for web applications. Selenium provides a record/playback tool for authoring tests without learning a test scripting language.
Left by Blair Oliver and Scott on 8/30/2010 1:29 AM
# re: Selenium and TFS
Gravatar Second one, when will be support for ToList() or ToArray(). It breaks when is called ToList() with System.convert Queryable to List.
Left by fm stereo transmitter on 8/30/2010 7:14 AM
# re: Selenium and TFS
Gravatar Selenium dioxide is the chemical compound with the formula SeO2. This colorless solid is one of the most frequently encountered compounds of selenium.
Left by Iqor on 8/31/2010 3:37 PM
# re: Selenium and TFS
Gravatar Thanks for a great time visiting your site. Pretty good post. I just stumbled upon your blog and wanted to say that I have really.
Left by SEO Company India on 9/1/2010 11:21 AM
# re: Selenium and TFS
Gravatar You got a really useful blog I have been here reading for about an hour. I am a newbie and your success is very much an inspiration for me.
Left by POS Software on 9/1/2010 11:44 AM
# re: Selenium and TFS
Gravatar Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with more information? It is extremely helpful for me.
Left by Subprime Affiliate Network on 9/1/2010 11:45 AM
# re: Selenium and TFS
Gravatar I would like to share it with all my friends and hope they will like it too.
Ciplex | Ciplex
Left by Ciplex on 9/1/2010 11:47 AM
# re: Selenium and TFS
Gravatar
A lot of thanks for sharing your ideas, I think this would really work,
I will it and come back here to tell you if it did work for me.
Left by Equidebt . on 9/1/2010 3:06 PM
# re: Selenium and TFS
Gravatar Thanks for that important information, its really helpful.
Left by Sales Recruitment on 9/2/2010 11:08 AM
# re: Selenium and TFS
Gravatar I like your blog post. Keep on writing this type of great stuff. I'll make sure to follow up on your blog in the future.
Left by IT Recruitment on 9/2/2010 11:09 AM
# re: Selenium and TFS
Gravatar

Pretty Interesting post. Could not be written any better. Thanks for sharing!Milestone Search| Milestone Search|Milestone Search


Left by Lara on 9/2/2010 11:11 AM
# cheap nfl jerseys
Gravatar I would like to share it with all my friends and hope they will like it too.
:)
Left by cheap NFL jerseys on 9/3/2010 3:34 AM

Leave Your Comment

Title*
Name*
Email (never displayed)
 (will show your gravatar)
Url
Comment*

Please add 7 and 5 and type the answer here:

Preview Your Comment.