open.qa.logo Selenium is a test tool for web applications. Selenium tests run directly in a browser, just like real users do. It runs in Internet Explorer, Mozilla and Firefox on Windows, Linux, and Macintosh, Safari on the Mac.&160; They have plans to target Safari on the iPhone in some months. The tool is free and available under Apache 2.0.


  • Install the firefox plugin, note the latest version work only in Firefox 2.0 not in 3.0Beta!
  • Install also XPather another Firefox extension, very helpful to get the elements&160; XAPTH in pages.
  • Of course restart Firefox
  • Open either the sidebar (go to menu View, Sidebar, Selenium IDE) or the floating windows
    (go to menu Tools - Selenium IDE)
  • Go to the page where you wan to test something
  • Put the right Base URL (A) and press button (B) when ready
    doYourFirstSeleniumTest
  • You can now act like any user, enter data, change values, click on links
  • When You wan to add a check, you can at any time right click on a HTML element
    (a text, a cell, a button...) to see what selenium is proposing you.
    doYourFirstSeleniumTest.2
  • Not all possibility are proposed...so this is where knowing the element XPATH is helping...
    for more complex check, you can right click on any element and get the XPATH
    doYourFirstSeleniumTest.3 doYourFirstSeleniumTest.4
    now just cut and paste and feed the command (I choose verifytextPresent)
    doYourFirstSeleniumTest.5
  • Don't forget to stop the engine when you are finished or the script may be huge.
  • Into C, You can now cut and paste one or many lines, insert new commands (add more assert)
  • And replay seleniumSecurityImages2 till the&160; bar is green

&160;

Attention:

  • Do not abuse XPATH expression as it somehow hard code the previous position of the element in the page.
  • Try to make each test run on its own, do not expect that the test before is successful (so login. test functionality 1, logout)
  • Keep unit test small,
  • Keep all test in a repository (CVS or SVN) or many backup.

Read also:

comments powered by Disqus

You might like also

Display the short GIT version hash as build identifier in TeamCity
TeamCity is a Continuous integration and build management server from JetBrains. As the first build step, create a custom script that reads %build.number%, and uses service messages to append the short GIT hash programmatically. Here’s an example using a bash script pasted right into the TeamCity GUI (Runner type: Command Line, Run: Custom Script): GIT_HASH=%build.vcs.number% GIT_HASH_SHORT=$ echo "#teamcity[buildNumber '#$']" &160; …
1812 Days ago
Latest JetBRAINS Teamcity 5 plugin for the Tux Droid
I did refresh the tuxdroid teamcity plugin project a bit on request to Jasper Moltke Nygaard (Danmark ) TeamCity is a Java-based build management and continuous integration server from JetBrains, creators of IntelliJ IDEA and ReSharper With this plugin you can notify your Tux Droid with your TeamCity build results. After login you can find the new notificator Tux Droid in your notification settings. You need your Tux Droid server IP and port to connect your Tux to TeamCity. After …
3134 Days ago
Running Selenium Grid and a set of Remote control as NT services
Selenium has various projects that can be combined with each other to create a robust testing environment. Selenium IDE: a Firefox add-on to record and playback tests in Firefox. Selenium Remote Control: a client/server system to control web browsers locally or on other computers, using almost any programming language and testing framework. Selenium Grid: transparently distribute your tests on multiple machines so that you can run your tests in parallel, cutting down the time required for running in-browser test suites. …
3153 Days ago
Install Atlassian Confluence in 15 minutes
In this small post, you will learn how to install Atlassian Confluence in no more than 15 minutes. It do not replace the online installations manual (The Confluence Installation Guide is for people who are installing Confluence for the first time. Check the requirements and supported platforms, then download and install Confluence), but mainly complement it, with some of the best Linux practices (ADDED points).         How to install Atlassian Confluence in 15 minutes Create user and …
3272 Days ago
No Thumbnail was found
Amazon EC2 and Virtual Agents Take avdantage of cloud computing with TeamCity by putting Build Agents on Amazon EC2. After your Build Agents' AMIs (Amazon Machine Images) are registered, the TeamCity server will account for those virtual machines in its build scheduling and will automatically do a suspend/resume job on them, based on the load and build queue status. Better Support for Maven Version 5.0 has many Maven support improvements under the hood. These include the creation of Maven-based build …
3333 Days ago
Update JetBrains TeamCity in one click
&160; A small script developed to upgrade TeamCity with no or less effort! a very simple script, easily extensible. “TeamCity is a continuous integration and build management system. With TeamCity, you can set up a build server within minutes and enjoy out of the box continuous unit testing, code quality analysis, and early reporting on build problems — even without leaving your favorite IDE. TeamCity offers a gentle learning curve, so you can quickly improve your release management practices by …
3460 Days ago
Adding Google analytics to Atlassian Bamboo
As I found no better tutorial on Internet, here is a very very short how to add Google analytics to Atlassian Bamboo, it require a bit of hacking, and these kind of changes will be lost after each upgrade of Bamboo.. Edit the file webapps/ROOT/start.ftl Now put the usual code you get after creating a new analytics profile just before the </body> …
3548 Days ago
Continuous integration server Bamboo up and running
My Bamboo continuous integration server is now fully functional and available at&160; http://bamboo.waltercedric.com/ &160; &160; &160; Remember Atlassian is providing free license for Open Source Projects: Atlassian supports and believes in the Open Source movement - Bamboo utilizes a number of good Open Source components, and Atlassian developers are committers on a large number of Open Source projects. To give back to the open source community (and hopefully improve the quality of those projects!), Bamboo is free for any Open …
3551 Days ago
TeamCity 4.5 up and running
Today JetBrains announces the public availability of TeamCity 4.5, it's award-winning distributed build management and continuous integration tool. With TeamCity, you can set up a build server for your projects within minutes and enjoy out of the box continuous unit testing, code quality analysis, and early reporting on build problems - even without leaving your favorite IDE. TeamCity offers a gentle learning curve, so you can quickly improve your release management practices by gradually adopting its advanced features and capabilities. …
3554 Days ago
Installing JIRA standalone on OpenSuse 11.x/ Plesk 9
JIRA is a proprietary enterprise software product, developed by Atlassian, commonly used for bug tracking, issue tracking, and project management. JIRA is widely deployed within public open source projects and has over 12,000 customers in over 100 countries. Visit my JIRA instance at http://bugs.waltercedric.com or http://jira.waltercedric.com&160; This is now officially my new Tracker. (Thanks to Atlassian for giving me an open source license) …
3561 Days ago