want to change index dynamically of WebTable object - 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: want to change index dynamically of WebTable object (/Thread-want-to-change-index-dynamically-of-WebTable-object) |
want to change index dynamically of WebTable object - atanu - 05-03-2011 need a urgent help. I am new to QTP.I am facing a problem about object identification in QTP. When i add a standard checkpoint. the code is generated like Code: Browser("Application").Page("Application").Frame("main_Frame").WebTable("Security").Check CheckPoint("Security") QTP can identify the WebTable object uniquely using Ordinal Identifier Type - Index and it's value. But when if any development on this application, value of Index of WebTables are changed. So Check Points related to the webtable are failed. So i have to modify Index value of webtables after every new deployment. so is it possible to set the index dynamically or any other approach which can avoid this problem. If possible Please let me know how to do that. Thanks in Advance... RE: want to change index dynamically of WebTable object - supputuri - 05-03-2011 Hi Atanu, First thing is check and choose the properties that can identify the object unique in different builds/application versions. Second option : dynamic handling of the index value of the webtable. Code: Dim intCounter : intCounter = 0 RE: want to change index dynamically of WebTable object - atanu - 05-04-2011 Hi supputuri, First option is not possible in this application as there is no unique object properties. Second option, When i execute this code,the loop condition is never true. So loop is not stopped. RE: want to change index dynamically of WebTable object - tdevick - 05-04-2011 Atanu, Try using descriptive programming to find all of the web tables with name "Security". This code searches frame "main_frame" for all web tables with the name "Security". "children.count", in the code below, is the number of such tables found. Then you can loop through the tables found, one by one, and do whatever you want. Maybe this will do what you want or give you some more ideas on how to solve your problem. Tim Code: oDesc=Description.Create RE: want to change index dynamically of WebTable object - atanu - 05-07-2011 Thanks both for your reply.It helps to find out the solution. Now I have solved this problem by two ways 1> Using regular Expression and runtime object Property(Without changing the index) The code is like this, Code: Set obj = Description.Create 2> Change the WebTable index dynamically The code is like this, Code: Set obj = Description.Create RE: want to change index dynamically of WebTable object - anshikagoyal - 07-13-2012 I am very new to QTP and VB script Can you please explain the logic you have applied inside the function GetQTPTableIndex in index method Also what is purpose of below condition and from where is iCount coming? Code: If iCount <> 0 Then Thanks in advance!! |