Micro Focus QTP (UFT) Forums
Use Regular Expression in Wait property - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Use Regular Expression in Wait property (/Thread-Use-Regular-Expression-in-Wait-property)



Use Regular Expression in Wait property - TurtleRock - 06-18-2010

Hi,

I need to know can we use regular expression in wait property.

I am using following line to wait for a message box with message "Pass'.
Code:
Dialog("Main").Static("Execution").WaitProperty "text","Pass"


Now, the message box to which i am applying this, may have "Pass","Fail",or "Abort".

Can we use regular expression in wait property so that any text will work for wait property.


Regards:
TurtleRock


RE: Use Regular Expression in Wait property - guin.anirban - 06-18-2010

You can use regular expression for this one like [A-Za-z0-9]. But i think this will not be the actual checking.


RE: Use Regular Expression in Wait property - QTPLearn - 08-06-2010

Well As par my knowledge for your scenario ,'Regular Expression' will not work. Mostly 'Regular Expressions' works with object properties but not with Constant values.


RE: Use Regular Expression in Wait property - venkatbatchu - 08-07-2010

Hi Turtle,
As you were saying that u would be waiting for the message box with message pass.

Solution: For this scenario you no need to use any regular expression over here.
You could go with either Do Until or Do While

If you are sure that you are going to get message box with message Pass then you could apply "Do Until"

If you are not sure about the message which you get then you could go with "Do While"

Please let me know for further clarification.


Venkat.Batchu