Micro Focus QTP (UFT) Forums
Condition/Outcome Branching within Script - 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: Condition/Outcome Branching within Script (/Thread-Condition-Outcome-Branching-within-Script)



Condition/Outcome Branching within Script - danielrose01 - 06-12-2012

I am trying to build a case for purchasing QTP and Q/C.

The way I am trying to justify this purchase based on the time we spend performing our regression testing. For example, we conduct 652 hours of regression testing per year.

Based on what I saw of the demo, I am figuring that it would take about 8 hours to convert our existing manual scripts into QTP scripts. I am basing this on the fact that QTP does a good job of recording and play back. That is the easy part. The hard part is converting that recorded script to use a Data Driven spreadsheet. This spreadsheet would allow the Test Script to conduct multiple iterations but using different values in the various field.

Now, the hard question. This software looks like it can do a good job of RECORD and PLAYBACK form of automated testing. How will this product do on reactive testing. By reactive testing, I am mean providing a way to do Condition/Outcome branching within the TEST SCRIPT. For example, when a value of a drop down box is selected, skip over a few steps and proceed to a different step. Like this:

1. User enters a User ID and password, and selects a value from a drop down box. This drop down box contains a User Role. A User Role could be "Analyst", "User", "Customer". Based on the value of the role, the script would have to skip and execute different parts of the script.
2. If User Role = Analyst, then display the entry screen for "Analyst".
3. If User Role = User, then display the entry screen for "User"
4. If User Role = Customer, then display the entry screen for "Customer".


Any help would be appreciated.

Thank you!


RE: Condition/Outcome Branching within Script - Ankesh - 06-12-2012

Hi danielrose01,

QTP supports all conditional/Bracnhing statements like IF ..Else, Select Case and loops.

you can put multiple conditions in the script based on your requirement. To do all this, you must have knowledge of vb script.

Do let me know if you need more help.

Regards,
Ankesh






RE: Condition/Outcome Branching within Script - danielrose01 - 06-12-2012

Thank you for your reply. I have more questions on this

Does this mean that to support IF ..Else, Select, Case, and loops you need to have VB scripting experience?

I am trying to sell this as a simple tools that can capture and play back test scripts and if need be support a little more. If the analyst has to learn VS scripting to do this, then this product will slide to disuse.

Right now, analysts take manual test scripts and manually key in the data, perform mouse clicks, and evaluate the test results. The test scripts are created using MS WORD and sometimes maintained (which is a huge problem).

What I had hoped was that these manual test scripts would be converted into QTP scripts by simply recording the manual test process. Next, they would be "converted" into data driven scripts quickly. The QTP script could be printed out to and used for training purposes. Finally, Q/C would run these scripts at night and the test results (failures, etc) would be mailed out.

Is this model achievable without the need of VB scripting?


RE: Condition/Outcome Branching within Script - sshukla12 - 06-13-2012

Hi,

For ur requirement, a bit of VB scripting is needed. VB scripting is not tough , it is quite easy and won't take 2 much of efforts in implemeting the logics to make ur scripts robust and modular.

Regards,
Sankalp