Feature Release: Include, Alias, and Variable Enhancements

The most recent release of Toffee Composer includes several improvements that improve its usability and extend its testing reach.

Parameterized include statements

The include command already allows you to include the contents of one script inside another. We have added a where clause to the include statement that allows you to pass variables into the script, e.g.

include script "Log in to Composer" where browser is "chrome" and username is "khoerr@toffeetesting.io"
include script "Rotten Potatoes" with movieTitle = "TMNT"

See our “Understanding Scripts” documentation for more information.

The real payoff for this feature is what it means for aliases. Previously, you could alias only single commands; now, you can alias a sequence of commands – that is, your script – as follows (continuing the examples above):

log in as khoerr@ksmpartners.com using chrome 
search Rotten Potatoes for movie TMNT

This feature hides the complexity of multiple test steps behind a single statement, making your tests even more readable, accessible, and robust.

Saving variables off the glass

Often your application under test (AUT) will generate values that your tests cannot anticipate. A common example is unique identifiers generated from a sequence or a randomizer. Although you as a tester have no control over the contents of these variables, you still need to save and use them in your tests to reference whatever it is that those identifiers identify.

We have added two new commands that allow you save values “off the glass” and store them in variables. The first, “save value of,” reads the value of any locator-addressable element, such as a text box, and stores it in a variable. Example:

save value of textbox with id "studyId" as newStudyId

The second, “save attribute,” is more general: it saves the value of any attribute of any locator-addressable element. Example:

save attribute "href" of link "Documentation" as DocLink

For more information, please see our “Save and Use Variables” documentation. You must download and install version 723 or higher of Toffee Performer to use these commands.

Other enhancements

  • From the script editor, you can now convert a native Toffee command in a script to an alias. Just click the “Convert to alias” icon (an eye) for that command, enter an alias, and save.
  • From the Composer Workspace, all available aliases are now included in the auto-suggest list. (To make an alias available from the workspace, you must include a script that defines the alias.)
  • Toffee Performer release 723 includes the most recent drivers for Chrome, Firefox, and Internet Explorer.

If you have not yet joined the Toffee Early Access program and created your free Toffee Composer account, get started today!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.