![]() |
Unable to click on the WebButton with specified Index - 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: Unable to click on the WebButton with specified Index (/Thread-Unable-to-click-on-the-WebButton-with-specified-Index) |
Unable to click on the WebButton with specified Index - srach84 - 03-30-2015 Hi, There are multiple buttons on a web page with the same name - "Edit". I have tried to use Descriptive Programming/Index property to click on the WebButton with a certain Index. However, the script clicks on a button with the Index=0. Please find the screenshots with explanation and advise me on the code to provided in the script. Thanks, Shilpa R. RE: Unable to click on the WebButton with specified Index - supputuri - 03-30-2015 Are you using descriptive programming or object repository? I hope the edit button might be added under first container that the reason why it's hitting the first button always. Check the hierarchy in your script or object repo. if you need any further help please post the pseudo-code and object spy screenshots of the 2 edit bottons. RE: Unable to click on the WebButton with specified Index - srach84 - 03-31-2015 Hi, I have used descriptive programming to click on the Edit button as below, however, it still selects the first Edit button instead of the Index Code: Descriptive Programming Code – On the other side, I have added the same Edit object with different Indexes in the Object Repository named as Edit_1, Edit_2, etc. and provided the code as below. The Edit button is clicked based on the position of the Index. However, this might not work if there are large number of Webbuttons with the same name as it is a tedious process to add the same object with different name in the Object Repository. Please find the attachment on the code and snaphots of the Object repository and the Object properties from Object Spy. Thanks, Shilpa |