06-04-2008, 03:10 PM
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
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
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