Configuration

How to configure a solution in Testware Framework Manager

Overview

The configuration in Testware Framework Manager is in overall terms, the collection of settings required for enrollment of web page into an page object based Object Repository.

In general, it is important to perform a thorough verification of the default settings as well as adding your custom adaptions to accomplish a useful configuration.

Creating the final configuration may be an iterative process with several attempts of enrollments and adaptions to your configuration as you get more and more experienced along the way.


Setup Solution

A Testware Framework Manager solution consists of three coexisting elements...

  • Configuration - A Testware Framework Manager configuration file...
  • Object Repository - An XML based Object Repository file...
  • Visual Studio Solution - A Visual Studio IDE solution...

These three elements will be generated automatically when creating a new Testware Framework Manager solution.

During the process of creating a new solution, you will be asked to specify the basic environment properties for your website application.

The Create New Solution dialog operates with five properties...

  • Name - Specifies the name of the website application...
  • URL - Specifies the starting URL for the website application...
  • User ID - Specifies login ID credential for the website application...
  • Password - Specifies login password credential for the website application...
  • Directory - Specifies the directory location of the generated solution...

The properties User ID and Password are depending on the existence of a login sequence.

Creating a Solution

  1. Choose the File->New entry from the file menu to open the dialog...
  2. Enter the name of the website application in the Name property...
  3. Enter the starting URL for the website application in the URL property...
  4. Enter the user login for the website application in the User Id property...
  5. Enter the user password for the website application in the Password property...
  6. Select a directory location for the solution by choosing the browse button...
  7. Press OK to generate the Testware Framework Manager solution...

A new solution has now been created in the directory specified...


Setup Environment

The Environment properties specify the credentials for the website application. When creating a new solution the basic properties will automatically be transferred into the configuration dialog.

images

The Page Identifier properties specify settings that uniquely identify a web page. The Page Identifier is used both during enrollment to extract the web pages into page objects and in the synchronization mechanism during the execution of tests.

The configuration operates with four properties for the Page Identifiers...

  • Title – Include the web page Title in the Page Identifier synchronization...
  • URL – Include the web page URL in the Page Identifier synchronization...
  • Context – Include a web page Context locator in the Page Identifier synchronization...
  • Locator – Specifies an XPath for the Context locator in the Page Identifier synchronization...

The picture below visualizes the different Page Identifiers on a web page...

To find the most suitable Page Identifier setup for a website a quick investigation is required. Use the browser to determine the unique Page Identifier synchronization.

During this investigation ask yourself...

  • Does the Title change on every web page on your website?
  • Does the URL change on every web page on your website?
  • Does the Context change on every web page on your website?

Creating a Page Identifier

  1. Select the Environment tab in the Configuration dialog...
  2. Choose the globe button to open a browser session...
  3. Enter the login credentials in the browser if required...
  4. Manually navigate through several web pages on the website...
  5. Notice the changes in the different Page Identifiers in the browser...
  6. Specify the most unique Page Identifier in the configuration...

A Page Identifier has now been specified in the configuration...


Setup Login

For most web applications some initializing steps are required before you reach the main application e.g. when having a login session with a sequence of manual interactions.

Predefined steps are automatically added during the creation of a new solution but these are defaults based on best-guess and must be validation or adapted.

If the website does not have an initializing sequence of steps the Login definition should be left undefined in the configuration.

images

To finally validate the defined Login sequence the WebPage Explorer may be used to launch the website with the custom login credentials.

Creating a Login Sequence

  1. Select the Login tab in the Configuration dialog...
  2. Choose the Add button to create a new Login step definition...
  3. Fill-in the properties in Add Step dialog for the new definition...
  4. Choose the OK button to complete specifying the Login step definition...
  5. Repeat creating the remaining Login steps definitions in the configuration...

The Login sequence has now been specified in the configuration...


Setup Panes

To follow the principles of the Page Object Model design pattern, a web page should be divided into several smaller page objects to ensure a well-organized repository with minimal redundancy.

As an assistance to this task, the Pane definitions are used during enrollment to extract portions of a web page into several page objects in the repository.

images

The Pane definitions may be used for both including and excluding portions of web pages into the object repository.

The configuration operates with four different types of Pane definitions...

  • Menu – A Pane definition for areas with navigation links common for all web pages...
  • Component – A Pane definition for areas with web controls common for all web pages...
  • Page – A Pane definition for areas with web controls specific for each web page...
  • Ignore – A Pane definition for areas with controls to be excluded for all web pages...

The picture below visualizes an example of a website with different Pane definitions...

images

A Pane definition has the following properties...

  • Name - Specifies the custom name for the Pane definition...
  • Type - Specifies the page object type of the Pane definition...
  • Locator - Specifies the web page XPath locator for the Pane definition...
  • Descend - Includes navigation of the web elements in the Pane definition...
  • Dynamic - Enables merging of existing page objects in the Pane definition...
  • Disregard - Ignores navigation and enrollment entirely in the Pane definition...

The property Locator must be specified as an XPath and can be found manually in the DOM of a web page by using the browser DevTools functionality.

The property Descend controls the behavior of the navigation in the Pane definition and is only applied when using the WebSite Explorer. This may be useful to avoid navigation in areas with restricted links.

The property Dynamic controls the behavior of merging page objects with existing page objects previously enrolled and is applied when using both the WebPage Explorer and the WebSite Explorer.

The property Disregard controls the behavior of both the navigation and enrollment of the Pane definition and is applied when using both the WebPage Explorer and the WebSite Explorer.

Creating Panes

  1. Select the Panes tab in the Configuration dialog...
  2. Choose the Add button to create a new Pane definition...
  3. Fill-in the properties in Add Pane dialog for the new definition...
  4. Choose the OK button to complete specifying the Pane definition...
  5. Repeat creating the remaining Panes definitions in the configuration...

The Pane definitions has now been specified in the configuration...


Setup Controls

When executing tests we must be able to operate the web elements on a web page from within the page objects. This interaction is handled by Web Controls in the page objects of the produced framework.

The Control definitions are used during enrollment to extract web elements on a web page into Web Controls in the page objects.

The enrollment process will automatically detect and extract web elements on a web page uniquely matching the patterns and attributes in the Control defininitions.

images

When creating a new solution, a default setup of Control definitions is added automatically. For a start, these settings should be sufficient but can be customized at any time as you get more experienced with the outcome of the enrollment process.

A Control definition has the following properties...

  • Type – Specifies the type of a Web Control to be used during enrollment...
  • Locator – Specifies the XPath locator pattern for web elements to be extracted...
  • Attributes – Specifies the series of web element attributes to be matched...

The configuration operates with predefined types of Web Controls...

  • WebButton
  • WebLink
  • WebTextBox
  • WebRadioButton
  • WebCheckBox
  • WebComboBox
  • WebLabel
  • WebCustomControl
  • Etc.

Creating Controls

  1. Select the Controls tab in the Configuration dialog...
  2. Choose the Add button to create a new Control definition...
  3. Fill-in the properties in Add Control dialog for the new definition...
  4. Choose the OK button to complete specifying the Control definition...
  5. Repeat creating the remaining Control definitions in the configuration...

The Control definitions has now been specified in the configuration...


Setup Aliases

The names of the pages and controls are generated automatically based on the attributes in the web pages. These names may sometimes become unappropriated and renaming will be required.

To ease the process of renaming, the Aliases definitions are used during enrollment to performe the renaming the page and control names in the repository.

images

It is difficult to predict and specify the Aliases up front but will be useful during an interactive process. For a start, Aliases should be left undefined until you get more experienced with the outcome of the enrollment process.

An Alias definition has the following properties...

  • Name – Specifies the pattern name for objects to be renamed...
  • New Name – Specifies the new name pattern for the renamed objects...
  • Type – Specifies the type of repository objects to be renamed...

The asterisk letter used in the Name property will be interpreted as a pattern for matching several objects.

Creating Aliases

  1. Select the Aliases tab in the Configuration dialog...
  2. Choose the Add button to create a new Alias definition...
  3. Fill-in the properties in Add Alias dialog for the new definition...
  4. Choose the OK button to complete specifying the Alias definition...
  5. Repeat creating the remaining Aliases definitions in the configuration...

The Alias definitions has now been specified in your configuration...


The Video Guide