Selenium

Background

Selenium IDE is a tool for authoring repeatable tests that emulate user actions within a website. When selenium IDE is set to 'record' it keeps track of the actions you perform in the browser. You can instruct selenium IDE to keep track of certain steps along the way, such as 'Verify text is present' by right clicking inside the browser window, or by selectnig the command from the IDE window. Once you are done, you can export the test in a format that can be re-used in regression testing.

 

Installation

Requirements:

firefox http://www.mozilla.org/en-US/firefox/new/

selenium ide http://seleniumhq.org/download/

Once you have downloaded firefox, open firefox and then go to the above selenium link. click the link to download the lastest "Selenium IDE", from within firefox this should prompt you to install the plugin. Accept any agreements and allow the installation to complete. It may ask you to restart firefox before it can be used.

Usage

Opening the IDE

Open firefox

in OSX-> tools->Selenium IDE

in Windows firefox button -> web developer menu-> Selenium IDE

Once it's open it automatically records

 

Brett might want to fill in some solid usage examples.

 

Use Cases

Current Feature

Perform user action in TRN, and generate script in a way that confirms that the action succeeded

  1. Record bug in action
    1. go to TRN with firefox 
    2. turn on selenium 
    3. perform action to trigger bug
    4. create command(s) that checks that the functionality is working
      1. for instance; 'verifyTextPresent' Error
  2. Save the test case (use .html file extension)
  3. export the test case as Java / Junit 4, Webdriver (use .java naming convention)
  4. attach both files to appropriate JIRA, assign to developer (assumes JIRA exists for this bug)
  5. Developer checks in the files into the appropriate location, using the JIRA key in the commit message

New Feature

Once the new feature is confirmed to work in TRN, follow the same procedure of current feature

(follow the same procedure as current feature)

 

Confirmed bug

If the bug is confirmed, reproduce it in UAT, and generate a script that confirms that the action failed

  1. Record bug in action
    1. go to TRN with firefox 
    2. turn on selenium 
    3. perform action to trigger bug
    4. create a command that checks for the existence of the bug
      1. for instance; 'verifyTextNotPresent' Error
  2. Save the test case
  3. export the test case as Java / Junit 4, Webdriver
  4. attach both files to appropriate JIRA, assign to developer (assumes JIRA exists for this bug)
  5. Developer checks in the files into the appropriate location, using the JIRA key in the commit message

 

Open Issues

  • Where to store them in SVN?
    • in KFS svn, along side other tests, where is that?
  • Naming convention for the script files?

Known Issues

The way that selenium IDE records user actions is not environment agnostic, once a test case is recorded it is tied to the environment in which it was created**.

One solution to this problem is deploying the application over the root context on every environment. For instance dev.kfs.uconn.edu/kfs-dev would no longer use the 'kfs-dev' part.  This solution would require some thought for the Load balanced environments however because they share the base 'kfs.uconn.edu' URL.

**the IDE only understands the HTML format, where this statement is 100% true, however, when this format is exported to a .java api format, this is not completely true (can change the base of the URL there, but not the rest of it) 

 

 

Â