![]() |
Itereate through Link Items - 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: Itereate through Link Items (/Thread-Itereate-through-Link-Items) |
Itereate through Link Items - lucster - 04-28-2011 Hey guys, i am new to this board and the whole QTP. With this code i iterate through links on a website: Code: i=0 As u may know now, the parser dont accept this, because the function EXISTS is not possible to use in that context. Now i ask you, how i can define an end of my ieration? The count of iteration has to be variable. Anyone has an idea? thanks in advance, lucster. RE: Itereate through Link Items - vIns - 04-29-2011 Hi.. The above approach might NOT work as expected when you have only one link in the page. This is because, QTP uses index property only when multiple objects are found. When there is only one object, index property is simply ignored, so the above loop will repeat indefinitely. (even if you set index=10000, QTP's Exists property will return the value as True; but they all refer to same Link here) So, Take the count first and proceed. Code: Set chObj = Description.Create RE: Itereate through Link Items - lucster - 04-29-2011 This is how it works, your code needed some edit. Code: Set chObj1 = Description.Create ![]() |