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
- Record bug in action
- go to TRN with firefoxÂ
- turn on seleniumÂ
- perform action to trigger bug
- create command(s) that checks that the functionality is working
- for instance; 'verifyTextPresent' Error
- Save the test case (use .html file extension)
- export the test case as Java / Junit 4, Webdriver (use .java naming convention)
- attach both files to appropriate JIRA, assign to developer (assumes JIRA exists for this bug)
- 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
- Record bug in action
- go to TRN with firefoxÂ
- turn on seleniumÂ
- perform action to trigger bug
- create a command that checks for the existence of the bug
- for instance; 'verifyTextNotPresent' Error
- Save the test case
- export the test case as Java / Junit 4, Webdriver
- attach both files to appropriate JIRA, assign to developer (assumes JIRA exists for this bug)
- 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)Â
Â
Â
Â