Apr 12, 2007 / Acceptance and Regression Testing With Selenium: Part II - Selenium Specifics

0 comments

Why Selenium is special? There are just two key factors: it is easy to use, it may be adapted to your goals without much problems and effort. Simplicity and extensibility are key success factors in many applications and Selenium is not the exception. Why it is simple? What simplicity means for automated tests framework? As a tester I want easy tests creation, easy to understand format to tests maintainability and in the best case no programming at all. In ideal case I want to generate all automated tests right from my test cases. It means if I write test case it can be generated to something executable in minutes with single key push. While Selenium is not that powerful, it is closest tester-dream-tool I know about.

Recorder

Many tools have recorders, Selenium is not an exception. You may start web browser, run Selenium IDE and record any test you want. Funny thing is that we almost not use recorder to create tests for TargetProcess. Why? We find it more fast and easy to create test manually. Do you believe in that? Selenium tests are so easy to create that you even don't need The Recorder!

Format

Selenium test is just an old HTML file with various directives. Here is an example of simplest test

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>add_user</title>
</head>
<body>
<table>
<tr>
 <td>open</td>
 <td>http://localhost/tp2/Default.aspx </td>
 <td></td>
</tr> 
<tr>
 <td>verifyTextPresent</td>
 <td>ToDo</td>
 <td></td>
</tr>
</table>
</body>
</html>

Each test is selenium represented by set of actions or steps. And each step is a row in table. The example above has two steps and two rows (<tr> tag). First step opens url and the second step verifies that text ToDo presents on the page.

Learning Curve

It is small. Within an hour you will be able to create simple test and run it. Within a day you will figure out some best practices and will be able to create quite complex automated tests for your application. Within two days you will be able to create some extensions that optimize your work and make tests more robust. It is one of the simplest testing tools I had work with for sure. How much time you will need to learn WinRunner?

Here is the list of things you should know to create selenium tests:

  • Dozen of commands like open, click, verifyTextPresent
  • XPath basics (actually you need half an hour to learn them)
  • DOM basics
  • (optional) JavaScript, for extensions creation

Extensibility

Extensions mechanism as you expect is simple as well (I am tired of the word "simple", but such as Selenium!). All you need to do is add javascript function into user-extensions.js. There is one complexity however - you have to know JavaScript and DOM.

Labels: , ,

Apr 9, 2007 / Acceptance and Regression Testing With Selenium: Intro

0 comments

Quality Assurance is a very important part of any project (I think nobody will argue, maybe only some self-assured developers who “always write bug-free code”). In many companies testing is no-fun activity, since tests automation is out of there. Typical tedious process looks like that:

  1. QA persons read huge specification (or very small and brief spec which is even worth in such cases)
  2. Then they create test plan and set of test cases. This is the most interesting part of testers work
  3. Then developers push Release Candidate build into QA team and QA engineers execute all test cases manually
  4. After weeks of testing they create report that shows actual product quality

I should say that manual testing is the most boring part of QA work (unless it is an Exploratory Testing). Click here, check system message, fill that fields, click Save, verify results. It’s a very, very boring stuff. The worst thing is that in some cases the same test case should be re-run several times. Do the same things again and again? No one in IT industry likes that, we have computers to handle such things after all! So why manual testing widespread? There are several reasons:

  • Not perfect tooling support (especially for web development)
  • Usually (this tendency is changing) testers have a little or no programming experience to create automated tests
  • Managers in many companies think that effort required to create automated tests is “huge”, “too expensive”, “not worth the results”

Fortunately, during last several years something changed in the industry. First, agile development practices like TDD and Acceptance Testing adopted and became more popular. Second, simply genius tools appeared. In this article I will share our experience with Selenium — fantastic tool for acceptance testing in web-based projects.

Labels: , ,

Subscribe to the RSS feed
Stay tuned by having the latest updates via RSS
Follow TargetProcess on Twitter
Get in touch with our team

TargetProcess is an agile project management tool. It is designed to solve distributed teams problems and support agile development processes.



Key Features

  • Full Agile Project Management Support (Scrum, XP, Custom)
  • Productivity Tools (Tp.Tray, ToDo list, dashboards, Inline editing)
  • Customizable Development Process
  • Subversion Integration
  • Integrated Bug Tracking, Help Desk, Time Tracking

Get TargetProcess for Free (5 users pack)

Previous Posts



    follow me on Twitter

    Archives