Explaining how the real world works!     RSS Feed The Automated Tester on Twitter The Automated Tester on LinkedIn The AutomatedTester on github

Selenium Record and Replay Tutorial

Sat 19 Jul 2008

Lets start by starting up Selenium IDE. This can be found under the tools menu in Firefox.

When the has been started it will automatically recording. Now that we have this lets start playing around.

  1. Enter in numbers into each of the text boxes and then click on one of the buttons
    Value 1
    Value 2

  2. I have created a basic version of what a script should look like here. This is fine for testing the functionality of the page but there are other non-functional items that appear on the page that need to be checked so that they are on the page.
  3. When you have the IDE open from Firefox you get a extra commands available to your browser's context menu. Selenium Context Menu
    As you can see it gives you a number of different items for you to choose. It only shows one set of commands, there is normally 5 command categories available. These are open, assert,verify,store and wait. From there you can choose the an appropriate command.

    Note: Not all the commands appear in the context menu. This is just to help you get the most common commands.

  4. The next task that you should try is create a script that checks that certain items are on the page. This is definitely a time for testers to use their own intuition on what should be checked and what shouldn't.

    Note: Don't try and verify/assert the whole page. If you do your script will run very slowly especially if you start using xpath to specify where the element is.

    I have created a more substantial script for you all to use here.

  5. Lets start to create a test suite using the new functionality of Selenium IDE 1.0+. A test suite allows you to group test cases together. This is quite useful when testing behavioural areas. To start creating a test suite all you need to do is click on File > New Test Case. The IDE will create the test suite with your finished test case and a new test case.

  6. You will need to make sure that you save the test suite. If you forget to do this you will lose you test suite and will have to create one with new test cases. You will then have to hack it to get your test cases into the test suite.

  7. Good practise to make sure that you scripts work on the browsers that your application will work. There are little quirks in each of the browsers and we will learn about these in future lessons.

Once you have had gone through it yourself try do the same basic thing with your own websites

    Area: tutorials

blog comments powered by Disqus