2021 April Release

Test Migration (Locator and Action)Permanent link for this heading

Fabasoft app.test provides a way to migrate tests to a newer version of an application. This is accomplished by predefined XML files included in the Fabasoft app.test Eclipse Plug-in. These files can be used as they are or customized for individual use. They can be found in the “Resources” folder of the Fabasoft app.test Eclipse Plug-in directory.

Migration Mode

To use this feature, the used migration XML can be selected in “Window” > “Preferences” > “Fabasoft app.test” > “Migrator”. The migration mode needs to be enabled via the “Enable/Disable Migration Mode” toggle button.

Migration Using the AriaMigration Tag

The AriaMigration tag allows for highly customizable control over migration rules via regular expressions und custom Java methods passed in special migration classes within a JAR file. Typically, a migration file will have multiple AriaMigration tags. By default, all of the given steps in the selected XML file are executed in order.

The AriaMigration tag provides the following possibilities:

  • The from attribute is defined as regular expression and requires a corresponding to value and an attribute value.
  • The to attribute defines the string which will replace a match of the from attribute.
  • The attribute attribute defines the location of the test statement to be matched with the from value. In most cases, this will be "attribute='location'".
  • The method attribute defines the action that will be executed. It typically refers to one of the Java string classes replace, replaceFirst or replaceAll. If the method is given "method='java'" it may call a custom method further described by the javamethod, javaclass and jarfile attributes.
  • The javamethod attribute defines the specific method to be called.
  • The javaclass attribute specifies the class which contains the javamethod.
  • The jarfile attribute describes the path to a JAR file containing the javaclass called above. If the break attribute is set to true, the execution chain can be stopped if a match is found.
  • Java methods may provide various alternative results to a migrated statement. If this is the case, only one alternative needs to be matched for the "break='true'" attribute to be valid. In the interactive migration tool, the first alternative to match is used.
  • While the from value accepts input in the form of regular expressions, the “.” is replaced by “³”. This is to differentiate between the “.” as used in locations and the “.” as used in strings.

Simplified Migration Using Patterns

If the changes between versions are not that complex, it is often sufficient to define patterns which handle changes in the structure or names of controls.