Micro Focus QTP (UFT) Forums
incrementing a value during runtime - 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: incrementing a value during runtime (/Thread-incrementing-a-value-during-runtime)



incrementing a value during runtime - jlane - 06-08-2010

Hi all,
Quick question on using QTP. I have taken over a suite of tests which were written a few yrs back so trying to get myself up to speed.
One issue I am stumped at fixing is the following.
There is a list of icons a - z which are selected by a checkbox. So the first time I go in I select icon_a and it works correctly. Then the next time it goes it it tries icon_a again but this throws a pop up error because image is already in use. I have written a function to click on the ok button with this error which works but now I cant figure how to increment to icon_b, icon_c etc etc untill it finds one it can use. I cant use an incrementer because it will be a new run each time it tries this step.
Any one any ideas?
Thanks,
J


RE: incrementing a value during runtime - Jackomcnabb - 06-08-2010

you can build an array with all the button id's in and then increment on each element of the array