QTP Questions
Back
Next
- How to make arguments optional in a function?
A. Suppose there is a login window in the user name we can type any thing but while running its giving some error we can
avoid that error actually so, we can make the tsl as an optional so that if an error occurs it continues without stopping.
For example
Optional.Dialog("Login").WinEdit("Name:").Set "ssss"
These line make an optional now
- How to handle Recovery scenario in QTP. Give detailed explanation about recovery scenario?
A. Recovery scenario manager is used to handle exception. Exception is run time error,three steps to handle exceptions
1. Trigger event: Pop-up window,object state,test run error and application crash.
2. Recovery operations: Select an operation to perform when the trigger event occurs they are
1. keyboard or
mouse operation
2. close application process
3. function call
4. restart microsoft windows.
3. Post recovery: Select the last run operation you want to perform when the recovery operation is complete.
.test run options:
1. repeat current step and continue.
2. proceed to next step.
3. proceed to next action or component.
4. proceed to next iteration.
5. restart current test run.
6. stop the test run.
- How to use Regular Expressions in QTP? Give an example?
A. In QTP, dealing of Regular Expressions and varying object descriptions
can be handled by using Description Programming.
Ex. of using Regular expression is:
You just record yahoo login operation and click on Inbox link. Assume you got 10 new mails, then it shows like Inbox(10).
Read one mail, now it shows like Inbox(9). Now try to play the recorded script. It wont work. Now use Regular expression in Inbox link like:
"Inbox.*". At that time it will work.
- How you call functions in QTP?
A. Function to calculate the length of characters in a word -
Function countChar(st) /*Vbscript Function
charLength = Length(st)
End Function
Assume above function countChar is written in VBscript, now you are getting the text from the Application and calling
the Vbscript file and gets the length of the characters in the word.
Dim textValue.
textValue = Browser("Browser Name").Page("Page Name").Frame.
("mainFrame_5").WebElement("12").GetROProperty("innertext").
executefile "\*.*\countChar(textValue)" /*calling the Vbscript file.
textlength = charLength /*getting the text len.
- If you don't have any Knowledge on particular application but they give that application to you for Testing ?
Then How we wil move towards testing on that application?
A. In real scenario it will not happen .without knowing what you will test. You don't know what to test
so first study BRS,SRS or FS and then write testcases and take approval from your lead and then test your application
as a professional test engineer, I don't suggest any one to test without any knowledge.
If you go for testing without any knowledge then you don't complete you are testing.
- What is Descriptive Programming in qtp?
A. Whenever we make use of object repository in qtp,this object repository display's the properties of
object,thus such a huge storage property of an object make qtp to run slowly.Thus to overcome from such a drawback of
object repository in qtp we make use of descriptive programming in qtp.
- Types of output value in details.
A. Types of output values in Qtp are as follows:
1. Standard output value.
2. Text output value.
3. Data base output value.
4. xml output value (from application).
5. xml output value (from resources).
- Tell me about framework types and most used framework in real time.
A. Framework Types
1. Keyword Driven.
2. Data Driven.
