Micro Focus QTP (UFT) Forums
Proper Use Of QTP - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Proper Use Of QTP (/Thread-Proper-Use-Of-QTP)



Proper Use Of QTP - farhanalam - 03-24-2009

Hi All,

I would like to ask a question regarding the responsiblity of QTP when we prepare a test in QTP.

Application Example:

3 Input boxes:
Input1
Input2
Input3

One Button:
Calculate

1 Output Box:
X

How Application Works:
This is a web application (HTML) contains 3 input boxes as mentioned above. User types numbers in Input1, Input2, and Input3 and then hits "Calculate" button. The button calls a java script function named "CalculateX()" to calculate the X, and it is shown in X output box.

Test Data:
Input1=3
Input2=7
Input3=5
X=95

CalculateX is a function that have many business rules in it to calculate the value of X. Thats why we dont knwo how do we get "95" in X. What is the best use of QTP for this application, here are 2 approaches:

Approach 1: We can use QTP to find out if we are getting right value of X or Not. To do this we can provide an excel sheet where we provide 3, 7, 5, 98 for input1, 2, 3 and X respectively. It means if we get 98 in screen/page the test is passed otherwise it is treated fails.

Approach 2: Another group of people say that we should implement CalculateX function within QTP. When test runs QTP calls its own CalculateX function first and grab the value from X field from page and then compares. If both QTP caluclated value and page value are equal then test is passed, otherwise it is treated fails.

I think approach 2 is incorrect because:
- CalculateX should be hidden from QTP.
- CalculateX is a business function and nothing to with QTP testing.
- Code is duplicated in application as well as in QTP.

I think approach 1 is correct because:
- The test should know what the X will be if I pass 3, 7, 5.

If you understand my question, I would like to ask the best usage QTP for this above mentioned application so that we can use QTP for the purpose it is made for. Please highlight some comments where I can understand the role of different people and how they linked and benefited with QTP.

Thanks
Farhan


RE: Proper Use Of QTP - Ankur - 03-25-2009

Set aside QTP for a while, how will you approach the above question while doing manual testing? What does your test case document say?


RE: Proper Use Of QTP - farhanalam - 03-25-2009

Unfortunately, there is no test case document. The team wanted me to implement CalculateX function in QTP. Thats why I put the question in the forum to get the correct approach, what is the best test case for this application, and what input and output I can expect from QTP... in a proper way of QTP usage.

Thanks
Farhan


RE: Proper Use Of QTP - Ankur - 03-25-2009

I would say all these questions can be best answered by the team who has asked you to implement that function. Remember there is nothing known as "best test case". Test cases are derived from and acc. to the requirements.

You can ask your team some questions like:
  • Why do they want to implement this functionality in QTP?
  • How they would have done it w/o any automation tool?
  • What do they want to achieve out of it? etc

Hope that helps.