Regular expressions in leanft in C sharp

Regular expressions are really useful to identify the objects in LeanFT. We can specify the property values as regular expressions in 2 ways.
  • Using description programming
  • Using application model editor
Example with Description programming Suppose you want to click on the link which contains text Softpost. In this scenario you can write the property value as shown in below statement.
 
var leanFTLink = browser.Describe<ILink>(new LinkDescription
    {
    TagName = @”A”,
    InnerText =As.RegExp(@”.*LeanFT.*”),
    Index = 1
    });

Example with Application model editor In application model editor, we can specify the regular expression as shown in below image. You just need to click on the * icon in front of the property value which you want to make as a regular expression.

Web development and Automation testing

solutions delivered!!