Selecting a WebElement from a List of Web Elements - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming) +--- Thread: Selecting a WebElement from a List of Web Elements (/Thread-Selecting-a-WebElement-from-a-List-of-Web-Elements) |
Selecting a WebElement from a List of Web Elements - chrispraveen - 02-21-2012 Hi All, I am working on a scenario, where I need to select a particular item from a list of items in a Window. The I have written is below: Code: 'Initializing a Flag The problem I face with the above code is that some times the incorrect item gets selected to the "Selected items window". If I dont use index I get "Object description matches more than one WebElement" error. The incorrect item that gets selected is always just above or below the correct one. Most of the times code works properly, sometimes I got wrong things selected. eg: I need to select 'Delete' item whose innertext value is 'Delete'. Delete a value Delete Delte by name The aboce code selects, "Delete a value" or "Delete by name" instead of 'Delete' from the list. Note: No html id available. Im working on a Web application that runs in IE8. I hope someone could help me in fixing the codes RE: Selecting a WebElement from a List of Web Elements - chrispraveen - 02-22-2012 Just changed the order for selecing the items... It works fine..Very Wiered... |