How to use Regular Expression in QTP?Woluld appreciate if you explain with an example?

Showing Answers 1 - 3 of 3 Answers

QTP comes with extensive help for regular expressions with many examples.

Still giving you a very broad perspective of it -

Suppose we want to regularise an expression which has only digits and can contain a maximum of 2 digits, the expression will be [0-9][0-9]

Now the question arises - how and where to implement this. Suppose an object is recognised by qtp with index 45 in OR. This can change everytime a new instance of IE is created. Its advisable to use regular expressions at such places.

Similarly if we want to regularise characters in suppose text property, use .* to make any text acceptable in this property.

The more you do R&D on this topic, more you'll be comfortable with this. Try to regularise as many expressions as you can using reference material given by QTP. It'll be of great help. I hope this helps you to start.

  Was this answer useful?  Yes

Yogesh

  • Aug 8th, 2006
 

You can Import local sheet by Importing the sheet from excel sheet. You can import any sheet from any action, best approach to import all the required sheet at same time at the begining of the test.

You can use the same syntext that you use for the global sheet

For example

Import.DataSheet "c:/..../filename.xls, "Source sheet name", "Destination sheet name"

Import.DataSheet "c:/..../filename.xls, "Global", "Global"

Import.DataSheet "c:/..../filename.xls, "Action1", "Action1"

  Was this answer useful?  Yes

104865

  • Aug 9th, 2006
 

How to use Regular Expression in QTP?Woluld appreciate if you explain with an example?

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions