Runtime Object Identification Problem - 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: Runtime Object Identification Problem (/Thread-Runtime-Object-Identification-Problem) |
Runtime Object Identification Problem - qapandit - 06-19-2013 First of all I am very happy finding this awesome forum!! My first dsay and first post!!! Anyway, Let's jump into the problem! In one of QTP Scripts I have to add one row in each iteration in a Web-Table. I will have to add 1000 rows in this way, so 1000 iterations!!OMG Problem is that in each newly added row there are multiple Objects (Edit box and List). I need to perform action on all objects in each row. Please see below screen-shot. I had the same kind of problem last week. But only one weblist was being added in each iteration. I wrote the following code.It works fine. Code: Browser("...").Page("...").Link("AddRoles").Click But in today's scenario in each iteration multiple objects are being added (Edit box and List) in the run. I am confused how to identify them individually. Please help Gurus. RE: Runtime Object Identification Problem - qapandit - 06-19-2013 Did I do anything wrong? Still nobody is shown up witht he solution. Come on guys! Please help. RE: Runtime Object Identification Problem - basanth27 - 06-20-2013 I see that the list box and the Edit boxes properties may remain same. Why dont you use the index property to identify them for each row and then fill the data? RE: Runtime Object Identification Problem - Sathiya - 06-20-2013 hi, Hearty welcome to QTP world..... it would be great if you share the object spy screenshots so that we will analyse in depth. RE: Runtime Object Identification Problem - qapandit - 06-21-2013 I analyzed Object properties. There is no index number. id is very inconsistent. Is it possible to do something with creation time like Browser creation time? Can I modify my code (in main post?) for this scenario? RE: Runtime Object Identification Problem - qapandit - 06-21-2013 (Please see the Image in main post) The only difference I see in the edit boxes of first row (*Claim*) is increamental id. For each newly added field id values increaments. Please see the image below. Now is there anyway to handle this? RE: Runtime Object Identification Problem - basanth27 - 06-21-2013 You could use the iteration number to be passed as a parameter to the object. that way for each loop it will substitute the number and move to the next one. Eg: Code: for i = 0 to 10 RE: Runtime Object Identification Problem - Ankur - 06-21-2013 Just to clarify, index no. won't be available in the spy. You can use them to identify objects using Descriptive Programming. RE: Runtime Object Identification Problem - qapandit - 06-29-2013 Please see one of the the ids below. Bold (0) gets changed in each iteration. NewBulkInvoiceDetail:BulkInvoiceDetailScreen:BulkInvoiceItemsLV:0:BulkInvoiceItemsLV_ClaimNumber Numbers will be increased 0 to 1000. It is in the middle of the string. How I can put a increamental loop their? Let me give a try Ankur. Thank you so much! Hi basanth27 and Ankur. Thank you for your help. You guys are awesome! I am sorry as I am pretty new in QTP. The Ids for for 1st, 2nd and 3rd Editbox are Code: NewBulkInvoiceDetail:BulkInvoiceDetailScreen:BulkInvoiceItemsLV:0:BulkInvoiceItemsLV_ClaimNumber So This is how I am trying for the 1st one Code: For z= 0 to 1000 Please help me out. RE: Runtime Object Identification Problem - qapandit - 07-02-2013 Hi Guys! I could solve it. here are the codes Code: For z=0 to 999 Thank you again |