How to use Regular Expressions in QTP? give an example.

Answer Posted / uday

ex
if we take flight reservation table (coz its easy to
understand the concept)
just record the script like this
go to file open order give no 5
and go to fax order type any fax no click send
and stop recording
then go to qtp script just change the script (the order no
to 6 )
Window("Flight Reservation").Dialog("Open
Order").WinEdit("Edit").Set "6"
and run the script we get the error as qtp could not
identify the fax order no 5
then go to repository select fax order no change the value
to "fax order no. *"
run it u get it

Is This Answer Correct ?    46 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is test scheduleling?

2019


How to create runtime property for an object?

1452


Explain the concept of object repository and how qtp recognises objects?

532


I have written a code to fetch values fro access db and place in the fields. Iam using GetROProperty to fetch runtime values. Now i want to add runtime values to the access db in field v3. please help me. Its not writting in the db. Option explicit Dim con,rs,db,c Set con=createobject("adodb.connection") Set rs=createobject("adodb.recordset") con.Open "Driver={Microsoft Access Driver (*.mdb)};dbq=D:\Sales.mdb" rs.open "select * from tax",con Do while not rs.eof Browser("Sales Tax Calculator").Page("Sales Tax Calculator").WebEdit("incost").Set rs.fields("v1") Browser("Sales Tax Calculator").Page("Sales Tax Calculator").WebEdit("intax").Set rs.fields("v2") c=Browser("Sales Tax Calculator").Page("Sales Tax Calculator").WebEdit("outtax").GetROProperty("value") rs.MoveNext print c Loop Do while not rs.EOF rs.EditMode rs.Fields("v3").Value="3" rs.Update rs.MoveNext Loop Set rs=nothing Set con=nothing

1487


Is it possible to change the values of analog recording?

579






What is action split and the purpose of using this in qtp?

537


diff between qtp versions from 8.5

1571


Explain in brief about the quicktest professional automation object model?

519


Is it possible to split an action? How?

662


What is clean sweep?

1382


hi all here i have tab named "Workbench" By clicking on "workbench" tab.it displays 4 tabs like below workbench common cargo commercial charter "common" tab have 10tabs inside,"cargo" tab also haveing 15 tabs inside and remaining two tabs also having few tabs inside. when clicked on "common" tab.it displaying the script like tab("workbench").select"common" if i clicked on "cargo".it displaying the script like tab"workbench_2").select"cargo" if i clicked on "commercial".it displaying the script like tab"workbench_3").select"commercial" if i clicked on "charter".it displaying the script like tab"workbench_4").select"charter" I have used a "FOR LOOP" for common,commercial,cargo,charter tabs.it was stopped at second tab SO, CAN I RECOGNIZE "WORKBENCH_2,_3,_4" AS A SINGLE VARIABLE if not, can anyone plese help me to solve this

1518


which type of testing process are you following in ur company? how to recognize a qtp page?

1409


Hi there, I've installed a trial version of QTP to see if it works with my product but I cant automate selecting windows from a tree view? Can anyone give me any pointers? Many Thanks

1416


i have two questions for regular expression :- Q1. I have date pattern eg-29/11/2011 29-11-2011 29.11.2011 Que- if any separator is there between date,month and year pattern should match else it should not match eg- pattern should not match in case of 2911-2011 Q2. let say i have a string and there is a number in between of that string eg.-Amount 30002.234 successfully credited to your account . now i have to match this pattern in such a way that even if decimal is not there pattern should match ,how i will do this using regular expression

1029


How to handle dynamic objects in quicktest professional?

505