How to use Regular Expressions in QTP? give an example.
Answer Posted / vikas choubey
Some Times QTP does not recognize the application object
during second run Or it run first time successfully then
QTP gives an error cannot identified the application Window
object properties does not match with the test object. There
might be a case of window name /object name is getting
changed each time. Here we required the use of regular
expression
During Recording of Flight application QTP record the
flight application it identified the Fax order window name
property like this
It Text Property is Fax order 11
If you run this script Again it will give an error because
Fax order Window name will be
Fax order 12
Cannot identify the object “Fax Order No. 11″ (of class
Dialog). Verify that this object’s properties match an
object currently displayed in your application.
Line (1): “Window(“Flight Reservation”).Dialog(“Fax Order
No. 11″).Activate”.
Check regular expression check box A message will appear
click NO. Now change Text box value according to Regular
expreesion.
Fax Order No. 11 to Fax Order No.*
Here each time only last part getting changed here we use .*
as regular expression means it will check only Fax order No
text not whole string
Same case we can apply for different object properties if
they are getting changed
A regular expression is a string that describes or matches a
set of strings. It is often called a pattern as it describes
set of strings
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
how will you check how many members visited the website www.infosys.com?
If we put all properties in mandatory and assistive list of Normal Identification, Do we still need Smart?
I want to do Certification course in QTP. For this I request you to suggest the best Tutorial in PDF format. Hence, if possible, kinldy mail PDF file to my mail-ID: sushmapokhriyal79@gmail.com
What if recovery scenarios is also failed for identify the alert ? (We are handling unexpected popup through recovery scenarios but if still recovery scenarios also failed than what should be the approach)
Do you know how to connect database? Can you tell me the procedures?
Can any give an example(if possible templates) how to test web application using QTP. thanks in advance
i am looking job in perfomance testing using Loadrunner any one help me a project plz......?(Chandana) chs_29@rediffmail.com
What is the significance of “action 0” in qtp?
I used child objects to get the no of weblist present in the weblist.now i need to select the items present in each weblist ?How to do so
what are the limitations of smart identification in qtp 9.0
tell me QTP standards ?plz
Diff b/w test scenario's and test Procedures?
How can we import into Excel "Details" ,"Result" ,"Time" parameters from within a Results Report which is generated after a Run error when a script is executed in QTP? Refer E.g below Status Functionality Description RunDate Fail Login User should be able to Login 12/3/2007 StartTime EndTime Details* 1:31:58 PM 1:32:29 PM (this one i want)
How you know that a test case is a regression test case
who QTP recognizes the object stored in object repository?