Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Alternative to Switch case- Multi Select with value match
#1
Solved: 10 Years, 9 Months, 1 Week ago
Hello All,

I have come across a typical issue for decreasing performance overhead and reduce size of code in Automation Scriting through QTP.

I have a variable which gets value dynamically (abbreviated form).
From pool of data i have to compare and match to which string this value of variable is related to.

Eg: In state variable, i get value VA. State = VA
Now VA Corresponds to Virgina (state in US)

[ I have Pool of data with values - Virgina, Washington, Albama, Masachuestts, Alaska, New York, North Carolina, South Carolina, FLorida and so on-51 states ]

Going by traditional way was to use SELECT CASE

Code:
Select Case a

    Case "VA" State= Virgina
    Else State = "Invalid State"
End Select

The problem here is i have 50 odd states and
12-15 fields like States to compare and match. So the switch case increase scripting and performance overhead.

It would be very helpful if i get some idea as to declare the match part in some data definition format and decrease time instead of using SWITCH case.

Please suggest. Thanks is Advance

Luv & Regards,
Aakansha
Reply


Messages In This Thread
Alternative to Switch case- Multi Select with value match - by Aakansha_d - 06-04-2008, 03:10 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question what is the shortcut key used to switch between keyword view and expert view in qtp. shaileshanand86 5 11,273 02-13-2019, 03:58 AM
Last Post: zia003
  type mis match vishnu 2 4,185 01-14-2012, 12:12 PM
Last Post: vishnu
Rolleyes How to select multiple choices from Multi-Select weblist blavanya 3 9,528 01-03-2012, 05:55 PM
Last Post: shivu.hanu
  Not Invoked particular Test Case kotaramamohana 6 3,979 12-30-2011, 05:39 PM
Last Post: ravi.gajul
  FOR loop with nested CASE wheelercha 2 3,228 12-12-2009, 10:45 PM
Last Post: upadhyay40

Forum Jump:


Users browsing this thread: 1 Guest(s)