RCPTT Documentation Center
  • User Guide
  • FAQ
  • Back to RCPTT Main Site
  • Eclipse.org
  • Get Started
  • Test Case Editor
  • Control Panel
  • Assertions
  • Eclipse Command Language
    • New ECL Command Guide
    • ECL commands for Excel import and export
    • ECL commands for XML import and export
  • Contexts
    • Workspace
    • Workbench
    • Launch
    • Preferences
    • Parameters
    • Group
    • Folder
    • Default
    • Super
    • ECL Script
  • Verifications
    • Text
    • Table/Tree
    • Error Log
    • Time
  • Procedures and Variables
  • Test Runner
    • Arguments
  • Maven plugin
  • RAP
    • Install instructions
    • Record and Replay
    • Capability Contexts
    • ECL commands
    • Maven plugin
  • Integration
    • TestRail
    • Zephyr

Preferences Contexts

Introduction

Preferences contexts allow to ensure that correct Application-Under-Test preferences are applied before test execution. This can be particularly useful when preferences which control the behavior of pop-up dialogs are being set in your AUT. The well-known example, while not completely relevant to test execution, is the Confirm Exit dialog, which has the "Always exit without prompt" checkbox.

The Preferences Context editor displays tree of all available preferences and allows modifying/removing some of their values.

Move a mouse over highlighted areas on a screenshot below to get a documentation regarding UI elements

Context name. This name is automatically synced with file system name. Symbols in name which are not allowed in file names are replaced with underscore character.
All you need to know about tags
Use this button to open tag selection dialog with list of tags from another test resources
Make a snapshot of AUT preferences and copy them into this context
Applies preferences to AUT. If option is on, clears existing AUT preferences first
Arbitrary plain text associated with a context
Click this button to clear current AUT preferences first
Pretty much the same as Eclipse's standard Project/FileSystem import wizards, but imported resources go directly inside Preferences context, not inside RCPTT workspace.
You can manually add a preference into a context with this button
Removes selected preference(s) from a context
List of preferences which should be applied. You can change the value of any preference.

Preferences context example

In the UML Lab product when a user saves the UML diagram for the first time, the dialog popup appears which asks whether to turn automatic code generation on or off. Based on user input, it modifies its internal property com.yattasolutions.codegen.GenerateCodeOnSave and also sets com.yattasolutions.umllab.dontshow.generateCodeOnSave to true.

Thus, if a test case is recorded for the first time, clicking on any option on the dialog popup is recorded as well, but later this dialog does not appear and, as a result, execution fails since it cannot find the specified dialog. There are two ways to ensure that test always passes in this case:

  • Create preferences context with dontshow.generateCodeOnSave set to false
  • Create preferences context with dontshow.generateCodeOnSave set to true and remove script lines responsible for this dialog in the Test Editor

Important

While it is currently not tracked by RCPTT, the Preferences context may depend on AUT workspace content since the context may contain project-specific preferences. Therefore, it may also depend on a workspace context, if there is one assigned to the test case. In some cases, applying the Preference context fails if referred projects do not exist in the workspace. In order to prevent this, you should either manually remove corresponding project preference nodes or use this context coupled with the workspace context. In latter case, please ensure that your preference context runs after the workspace context (i.e. the preference context is placed below the workspace context in the Contexts section of the Test Editor).