what is the syntax for regular expression in QTP?
how to create user defined functions in QTP?

Answer Posted / naren

RE enables us to find objects and Text strings with varying
values
Dim re As New RegExp
Dim ma As Match
re.Pattern = "[A-Z][0-9][0-9][0-9]" ' uppercase char
followed by 2 digits
re.IgnoreCase = False ' case sensitive search
re.Global = True ' find all the
occurrences
For Each ma In re.Execute(txtSource.Text)
Msgbox "Found '" & ma.Value & "' at index " & ma.FirstIndex
Next

Is This Answer Correct ?    3 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Will down time for server and content maintenance/upgrades be allowed? how much?

605


Our company is having a windows client server application developed in vb.net. so there is a treeview and i am not in a position to record the click events in QTP. so kindly help. Vivek

1559


Explain in brief about the quicktest professional automation object model?

505


How extensive or customized are the server logging and reporting requirements; are they considered an integral part of the system and do they require testing?

560


How to handle Java tree in QTP?

739






Both static and dynamic arrays are handled by the vb script. Is it true?

547


When to use shared and local object repository?

622


Print the Prime numbers in below format only up to 20(Need commas also) 1,2,3,5,7,9,11,13,17,19

1172


Explain how qtp identifies object?

601


what is test scheduleling?

2002


What are the five challenges you faced in QTP?

2746


what is clean sweep?

1873


Is qtp supports uni-code?

600


How do you do batch testing in wr & is it possible to do in qtp, if so explain?

610


Is it possible to refer the same object for referring more than one object that are of different class using the descriptive programming approach? Suppose my code is 'To create the object named as obj Set obj=Description.Create() 'To define the values obj("title").value="IE" obj("type").value="text" obj("html tag").value="INPUT" 'To set the value Browser("IE").Page("Yahoo").WebEdit(obj).Set "xyz" Can I refer the "obj" object for the three objects like Browser,page and webedit objects? If so how?

1567