Overview

The Keyword Framework has been created to expand automated functional testing to a broader range of users, and to make people familiar with automation more productive. The Framework enables users to create test cases in a pipe-delimited format, which is read by the framework and passed on to the Selenium (webDriver) automated testing tool as an automated script. Users define their actions in simple terms understood by the framework, eliminating the need to learn a complex programming language.

Instructions for Creating Tests

Please find a sample script here. Scripts contain series of commands that tell the framework how to test the application. These commands are pipe-delimited, with one line per command. The first item on a line must be a recognized keyword. The list of recognized keywords can be found here. A good way to create a script is to walk through a manual test case, creating a script that mimics your actions. When you click on a button with a label of 'Login', just add the given command to your file:

click|Login

If you wish to verify the following text appears on your page "my sample text", add the following line:

verifyText|my sample text

If you wish to use a variable value, Add a $ to a variable name, like this:

click|$mySite

This line will read a variable called 'mySite' from a variables file and click on the contents of that variable.  This is useful in cases where you want to quickly change users or sites across multiple scripts.  The variables file will need to be specified in your parameters file, described in the 'Instructions for Running Tests' section below.

Once your script is completed, save it as a plain-text file. If your script(s) uploads any files, put these files in a common directory. The framework requires that a text file exist that contains the absolute path to your scripts and the order of their execution. For example, a test list might exist that contains the following lines:

Each of the scripts will be executed by the framework in the order it appears in the test list.

Instructions for Running Tests

The Keyword Framework is a standalone java application, written using Java 1.6. You will need to have an installed java jvm 1.6 or greater on your computer.

A parameters.txt file must be present in the same directory as the keywordFramework.jar file, containing the following information:

A sample parameters file for Linux users can be found here.

Once your scripts are written, and your parameters file is created, you are ready to run your tests.  Open a command-line and navigate to the directory which contains the keywordFramework.jar file and enter the following line:

java -jar keywordFramework.jar

The framework needs a few seconds to get started, but eventually a browser will launch and your test scripts should start to run.  By default, the browser is closed at the end of each test script and re-launched before the next one.  Don't be alarmed if you see browsers opening and closing frequently.

Instructions for Viewing Test Results

All log files are stored in the directory indicated by your logDirectory parameter. Separate directories (named after the timestamp of your test run) contain the logs of each test run. Within each sub-folder is a file called report.txt, which show which test cases passed and failed, as well as summary stats for all cases.  There are also individual log files for each test case.  In the case of failure, a screenshot is collected from the browser at the time of failure and stored in the same sub-directory as the log files.  The screenshot is named after the failed test case.

Tips and Tricks

Windows users attempting to verify downloaded pdfs may notice that your files open in your browser instead of downloading.  Within Chrome, this behavior can be modified by opening content settings and disabling plug-ins for pdfs.  I had two that needed disabling.

Download

The Keyword Framework jar can be download here.  The parameters files can be found here.

The source code is available here. Only the java files, and dependencies, are used in building the jar.

Some sample scripts are available here. These scripts are designed to work with the University of Michigan's branded version of Sakai (CTools). They will need to be modified to work in a Sakai QA environment.