Guide to Selenium Testing in OLE

< Back

Home

Next >

Introduction

Selenium Testing in OLE means that the tester is inheriting an issue in the OLETS Jira project for which the test case, steps, and automated test script have already been created. This can happen with certain issues, such as bug-fixes which have been requested by the QA team and now need a functional tester. It is also the norm with Round-2 testing of functional specifications.

Click on the images in this guide to expand them. If you have any questions or comments on the material presented in this guide, please email Rich Slabach or Jain Waldrip.

Top of Page

Getting Started

Install Selenium IDE

Selenium IDE is a Firefox plug-in that allows users to record and playback browser automation scripts. You can download Selenium IDE at http://seleniumhq.org/download/. If you do not have the Firefox web browser installed, you can download it from http://www.mozilla.org/en-US/firefox/new/.

For complete directions on installing and running Selenium IDE in Firefox, please reference the “Installation” section of Getting Started with Selenium.

Top of Page
Top of Section

Find Issues Assigned to You in OLETS

Open the OLETS Jira Project and log in with your Kuali KIS username and password. You will find the "Log In" link in the upper right-hand corner of the page.

Click on the “Issues” drop-down menu near the top of the screen. Highlight and click “Search for Issues.”

In the “Issue Navigator” pane, on the left-hand side of the screen, find the “Projects” list and scroll down to “OLE Test Scenarios,” then click to highlight it. A blue notification bar will appear below the “Issue Type” list:

Click on the red “Refresh Search” link and wait for the page to refresh. Scroll down until you see the title “Issue Attributes” in the Issue Navigator pane. The second field in this section should be “Assignee.” Click the assignee drop-down box and select “Current User.”

Scroll back up to the top of the screen and click the “Search” button. Once the page refreshes, you should see all of the issues currently assigned to you.

Any issue with a value of “Assigned to Test (RD 1)” or “Assigned to Test (RD 2)” is ready to be tested. Click on the “Key” or “Summary” field for any issue to open it.

Top of Page

Download & Run the Selenium Script

Once you have the OLETS issue open, scroll down to the “Attachments” section. The Selenium script will appear here as an HTML file. Right-click on the file and select “Save Link As...”

There may be more than one Selenium script to download for each OLETS issue. If this is the case, read through the steps to see if it’s necessary to run the test scripts in any particular order.

Once you have the test script downloaded, open Firefox, and then Selenium. You may have an icon providing a shortcut to Selenium on your Firefox toolbar. If not, open the Firefox menu, select the “Web Developer” category, and click on “Selenium IDE.” Selenium will open in a separate window.

In the Selenium IDE window, click on the “File” menu, select “Open,” and navigate to the appropriate test script.

Selenium does not allow multiple test scripts to be selected with the “Open” function. If you need to run multiple test scripts for your OLETS issue, you will need to select “Add Test Case” instead, about halfway down the length of the menu.

To run the Selenium script, you can click on the “Actions” menu and select “Play current test case,” or you can click the icon highlighted in the image below.

The Selenium script will be executed in whatever Firefox window was most recently active. Be careful not to run a Selenium script in a window you’ve been working in so that you don’t lose your work!

Top of Page
Top of Section

Determine Success or Failure

As Selenium runs, whatever command the application is currently executed will be highlighted in yellow in the “Table” tab. Once the command has been successfully executed, it will turn green. A failed command will turn red and return an error message in the log window.

If a given command is just performing an action, like clicking on a link, then it will turn a light shade of green or red once it finishes. If a given command is performing an evaluation, like verifying whether a given value exists on the screen, it will turn a dark shade of red or green once it finishes.

Some evaluations will cause a Selenium script to halt, and some will not. There are two basic kinds of evaluations in Selenium – assert statements and verify statements. An assert statement will cause a test script to halt and report an error if it fails. A verify statement will report an error message upon failure, but will not halt the test script.

Verify statements are used for two primary reasons in OLE Selenium testing. The first is to test a non-essential condition that may give a reviewer more information about why a test script failed. The second is when a Selenium script is being used to test a large number of values. For example, if a test script is testing an operation performed on a number of requisitions in the Order Holding Queue, the script may need to verify that all information about each requisition is displayed correctly in the queue before continuing. In this case, verify statements would be used so that if a single piece of information is missing, the test script can report exactly what information is and is not present.

Top of Page
Top of Section

Success

If the test script completes all commands and shows a status of one script run with no failures, then the script was completely successful. All you need to do in this case is pass the test case in the OLETS Jira project and add your comment (as explained below). Adding a screenshot of the successful run is helpful, but completely optional.

Top of Page
Top of Section

Failure

If a test script finishes running with one or more errors, the test was not successful. You will need to document your findings by adding a screenshot and a comment to your test case (as explained below).

If a test script has a number of “Verify” statements, it is possible that it will run with more than one failure. It is also possible that the test script will complete, but will also report one or more failures.

When a test script fails, the QA team needs to receive information about what caused the script to fail. If there is only one error, you can provide us with this information by taking a screenshot that shows the command which failed during execution. If there are multiple errors, it is more helpful to include the log information as a text file on the test case. This process will be explained in more detail below.

Top of Page
Top of Section

Document Your Findings

Updating the Test Case

Open the OLETS test case if you don’t already have it open. You should see the options “Test Passed” and “Test Failed” at the top of the screen. Click on the appropriate option, and a dialogue box will appear.

Enter the current date as the date tested. Next, you will need to select either “Passed” or “Failed” by hand in the section labelled “Test Results.” You will also have the option to attach a file by clicking “Choose File,” and then selecting the appropriate screenshot or log file in the file selection dialogue. You can attach multiple files, if necessary, by selecting “Choose File” again, after the first file has been attached.

After you have the relevant files attached, enter your comments describing the outcome of the test case. If the test script executed successfully with no errors, all you need to mention is that the test was passed. If the test script failed, you will need to explain the reasons why, and what errors you received (if any). If you are uncertain about how to document the outcome of a failed test, please do not hesitate to contact Rich Slabach and Jain Waldrip for assistance.

Once you have entered your comments and any attachments to be added to the test case, you will need to click on the button reading either “Test Passed” or “Test Failed” in the lower right-hand corner of the test results dialogue box. Once you do so, the test results dialogue box will disappear, and your comments and attachments will be added to the test case.

Top of Page
Top of Section

Adding Screenshots

There are two ways to create a screenshot for attachment to a JIRA issue. One is to use the built-in screenshot function on your computer, and the other is to use the JIRA screenshot function.

If you have a Windows computer, you can highlight the window you want to capture in your screenshot, and press the key combination Alt + Prnt Scrn. If you use a laptop, you may have to also press the Fn (Function) key to use the Print Screen key. This key combination will add an image of the current window to your clipboard. To save it, you can open a photo editing program like MS Paint, or word processing program like MS Word, and press Ctrl + V to paste the image into the document.

You can attach a screenshot saved in this manner in the test results dialogue (described above), or at any time using the “Attach Files” command. To use the “Attach Files” command, click on the “More Options” drop-down in the OLETS test case, and select “Attach Files.” A dialogue box like the test results dialogue will appear. Select the file using the “Choose File” button, enter your comment in the “Comment” field, and click

If you prefer, you can use the “Attach Screenshot” JIRA function. This function can also be found under the “More Options” drop-down menu. Once you click on the “Attach Screenshot” function, a dialogue box will appear, prompting you to take and attach a screenshot.

You will still need to use your operating system’s built-in screenshot function for this dialogue box. Highlight the window you wish to capture, press the Alt + Prnt Scrn key combination, then return to the screenshot dialogue box and click the “Paste” button. Once your image appears in the window, you have the option to enter a filename for your screenshot. You may also enter a comment describing the screenshot in the “Update comment” field. Once you’re ready to save your screenshot, just click the “Attach” button. The dialogue box will disappear, and your screenshot and comment will be added to the test case.

Top of Page
Top of Section

Log Files (Only Needed During Failure)

To attach a Selenium log as a text file, first keep Selenium open after the test has failed. If you’ve already closed the Selenium application window, you’ll need to re-open it and run your test script again to repeat the failure.

Once the script has run, click to select the Log tab at the bottom of the Selenium window. Left-click anywhere in the body of the Log tab itself, and press Ctrl + A (Cmd + A on a Mac) to select all text in the tab. Press Ctrl + C (Cmd + C on a Mac) to copy all selected text to the clipboard. Open a text editor like Notepad, and press Ctrl + V (Cmd + V on a Mac) to paste the contents of the clipboard into the file.

Now just save the text file and add it as an attachment to the OLETS test case, just as you would a screenshot.

Top of Page
Top of Section

< Back

Home

Next >

Operated as a Community Resource by the Open Library Foundation