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

Answers were Sorted based on User's Feedback



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

Answer / seethas

Uday is exactly correct.........

I m giving one example 4 regular exp.........
[1-9]--------->it accepts all 1 to 9 numbers......

Is This Answer Correct ?    10 Yes 1 No

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

Answer / uday

Regular expressions enable QuickTest to identify objects
and text strings with varying values.

You can use regular expressions when defining the
properties of an object, the methods of an argument, when
parameterizing a step, and when creating checkpoints with
varying values.

A regular expression is a string that specifies a complex
search phrase. By using special characters such as a period
(.), asterisk (*), caret (^), and brackets ([ ]), you
define the conditions of the search.

we can write the user defined in a notepad and save the
file as .vbs and we then associate that to Test-Settings-
Resources-Associate Library Files by clicking plus and
select the .vbs file. In the script we can call the
function with function name ()

Is This Answer Correct ?    10 Yes 7 No

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

Answer / ram

By using regular expression we can handle dynamic objects
in object repositiry.
When an object property will changing freaquently based on
input values that time we use regular expression.
we have nuber of regular expressions , But we are using 4
types of regular expressions * . ( )

Is This Answer Correct ?    1 Yes 0 No

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

Answer / 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

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

Answer / akshar jain

yes uday u r right

Is This Answer Correct ?    4 Yes 6 No

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

Answer / saravanaraja

Regular Expression is used only for the dynamically
changeable element like Time.

This is the Regular Expression for Time ("1[012]|[1-9]):[0-
5][0-9](am|pm")

Is This Answer Correct ?    2 Yes 4 No

Post New Answer

More QTP Interview Questions

where exactly we can't do the automation testing. give some examples

2 Answers   Virtusa, Wipro,


How to retrieve particular cell data in excel sheet ?without importing method.

3 Answers  


If an application name is changes frequently i.e while recording it has name "Window1" and then while running its "Windows2" in this case how does QTP handles?

1 Answers   Crea,


how can we retrieve ten rows from the data table using loop concept?

4 Answers  


I have written some script in QTP and i added those objects in Object Repository. All written script has been executed successfully. After few days when i tried to execute the same script i got error message "objects not found in Object Repositiry". How can we solve this issue?

3 Answers  






can we install qtp on server machine and do automation of application which is installed on client machine.If yes then how? If no then is there any other automation tool for this (client-server) senario.

4 Answers  


.how will you load the object during runtime

2 Answers   TCS,


why we use environment variables

5 Answers  


hi friends can anyone tell me where can i find descriptive programming material please send me the link also,from which i can download the material

1 Answers  


How QTP recognizes Objects in AUT?

1 Answers   Crea,


How to export(copy) the entire webtable from the webpage into Excelsheet? using Vb scripting

9 Answers  


what is the difference between Reusable action and external action?

2 Answers   HCL,


Categories