03-24-2009, 10:06 PM
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
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