![]() |
Using Regular Expressions - 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 Regular Expressions (https://www.learnqtp.com/forums/Forum-UFT-QTP-Regular-Expressions) +--- Thread: Using Regular Expressions (/Thread-Using-Regular-Expressions) Pages:
1
2
|
Using Regular Expressions - srinivasadityab - 10-04-2008 Hi I have started this new thread on this subject as my previous thread did not clarify me. Example1: I start to record a business process using QTP, Open http://www.hotmail.com, Sign in using my user ID and password. Click on Inbox(6), Read one mail and Sign-out. Now the Inbox link after reading one mail will become Inbox(5). Now on play back the test will fail as the test will search for Inbox(6). I would like to know how to assign a regular expression in the object repository for the above case. Exact syntax would be of great help . Example 2: This is the flight application that comes with QTP [attachment=112] I attached a .jpeg image in this thread. In the attachment you can Find the window titled Fax order no.29. How do I insert a regular expression to this Fax order title so that the playback can handle any number. I tried with few syntax but object not found errors are occurring while running the script Any help please?? Regards Srinivas RE: Using Regular Expressions - srinivasadityab - 10-06-2008 Please help me on the above thread. Your help is highly appreciated RE: Using Regular Expressions - somisays - 10-08-2008 Hi, Locate the Inbox(5) object in the object repository and select the name property and then click on <hash> then you get value configuration options select Regular Expression option. Hope this solves your problem.. RE: Using Regular Expressions - rajeshvelur - 10-17-2008 You can use in the Object Repositiory something like below: Inbox(6) will be in your obj rep. Change it to Inbox.* using the regular expression format. So whatever comes after Inbox, QTP will not care. It will look only for Inbox Thanks RE: Using Regular Expressions - surya_7mar - 11-29-2008 the best way for this is you can change the Object REpository to Regular Expressions with the format Inbox(\d*) RE: Using Regular Expressions - rahul1234 - 10-14-2009 Follow these steps 1. Open OR 2. Select the Fax Order No 3. In Test object details select the text value 4. Open the Value configuration options 5. Change the value [0-9] change only numeric value if fax order no is two digit no then write [0-9][0-9] 6. Check on Regular expression check box 7. Click No Run your script RE: Using Regular Expressions - qatestbrian - 10-21-2009 Hey All, This is all good stuff. I was wondering about the difference between your solution of: Inbox(\d*) and the solution of the previous thread of: Inbox.* What are the benefits and drawbacks of each of these very similar solutions? Thanks, Brian RE: Using Regular Expressions - jsknight1969 - 10-22-2009 The difference would be: Inbox(/d*) -- /d* means "digits"...0-9 and any length "*" Inbox* -- anything after "Inbox" alpha, numeric, or special chars and any length RE: Using Regular Expressions - qatestbrian - 10-22-2009 Thanks for the reply. Does the Inbox(\d*) speed up the execution of the statement in the script at all? So if you have say 1000 of these expressions and you are more specific in regards to what the following character can be (digits, character) (\d*) rather than just .* does that help optimize your scripts? Or does QTP not really care? RE: Using Regular Expressions - jsknight1969 - 10-22-2009 To the best of my knowledge one does not process any faster/slower than the other. the only difference would be in the pass/fail with what is allowed after "Inbox". |