Tricentis Tosca 16.0 Released on Feb-2023 ----- UFT has been upgraded from UFT 15.0.1 to UFT One 15.0.2, Beginning at November 2020.

Wednesday, 24 March 2021

What is Regular Expression -

It is a way of representing data using symbols. They are often used within matching, searching or replacing algoeithms. Regular expressions enables us to perform the following tasks.
  1. Pattern matching and replaces.
  2. Searching and replace.
  3. Replace
  4. Identifying required number or string.
Text strings get assigned to pattern property of a RegEx object.

Regular Expressions in UFT-

Regular expressions can be used in UFT for identifying objects and text strings with varying values.

Where we use regular expression
  1. Defining the property values of  an object in Descriptive Programming for handling dynamic objects.
  2. For Parameterizing a step.
  3. Creating Checkpoints with varying values.
Using Regular Expressions in UFT-

We can define a regular expression for a constant value, a data table parameter value, and Environment parameter value or a property value in Descriptive programming.

We can define a regular expression in standard checkpoint to verify the property values of an object, we can set the expected value of an object's property as a regular expression so that an object with a varying value can be verified.

We can define the text string as a regular expression, when creating a text checkpoint to check that a varying text string is displayed on our application, for example XML Checkpoint we can set attribute or element values as regular expressions.

RegExp Object

VB Script is providing RegExp object for defining Regular expressions, it provides simple support for defining regular expressions. RegExp comes with predefined properties and methods.

Properties
  1. Global Property
  2. IgnoreCase Property
  3. Pattern Property
Methods :
  1. Execute() method
  2. Replace() Method
  3. Test() Method
Global Property -
Global property  accept two values


























No comments:

Post a Comment

Note: only a member of this blog may post a comment.