Is there a better way to manage my If statements? - 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: Is there a better way to manage my If statements? (/Thread-Is-there-a-better-way-to-manage-my-If-statements) |
Is there a better way to manage my If statements? - mv8167 - 09-03-2011 Is there a better way to manage my If statements? My issue is; I have 10 or so dialog boxes and depending on which I have found, I need to use the code associated with the dialog box. I have 2-5 objects that I look for to determine which dialog box that I have. My problem; is, if the third If statement is not found, my code Exits all of my If statements. My goal; is to have code to search each of the set of Dialog boxes until it finds the correct “complete” match. My code: Code: '1 – Dialog Box How can I change my code so that if I reach 1-Dialog Box’s third If statement and Fails, the code will check the next 2 –Dialog Box’s code. Or must I complete each Dialog box’s If..If..If… EndIf…EndIf..EndIf statements, etc? |