Print Page | Close Window

Regular Expressions in RFT

Printed From: One Stop Testing
Category: Testing Tools @ OneStopTesting
Forum Name: Rational Robot @ OneStopTesting
Forum Discription: General-purpose test automation tool for QA teams who want to perform functional testing of client/server applications.
URL: http://forum.onestoptesting.com/forum_posts.asp?TID=6359
Printed Date: 27Dec2024 at 10:42pm


Topic: Regular Expressions in RFT
Posted By: AnithaRaman
Subject: Regular Expressions in RFT
Date Posted: 03Mar2009 at 5:15am

In RFT, regular expressions are helpful in validating dynamic data.

Suppose in your application you have a text that shows the current calendar date like this “Today's date - 03-03-2009”. Your test case is to validate that this information appears in the welcome page of your application each time you login. The current date is dynamic and changes each day. So the verification point as is cannot be used as it would fail when you playback the script the next day. In this scenario you can apply a data verification point to this text object on the application. Then convert the value into regular expression. So the regular expression would be something similar to this

(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d”.  Now when you playback the script the next day the verification point would continue to pass as it is been customized to accept dynamic or changing data.

This is an example for the usage of Regular expressions. Regular expressions can be used in many such scenarios.




Print Page | Close Window