Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Runtime Object Identification Problem
#1
Solved: 11 Years, 4 Months, 3 Weeks ago
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.
[Image: 1.png]


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

Set Desc = Description.Create()
Desc("micclass").Value = "WebList"
Set Lists= Browser("...").Page("...").WebTable("Roles").ChildObjects(Desc)
Lists.Count
Max = Lists.Count -1

For x = 1 to Max
Lists(x).Select "....."
Next

Browser("...").Page("...").WebList("....."). Select "......"
End If


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.
Reply
#2
Solved: 11 Years, 4 Months, 3 Weeks ago
Did I do anything wrong? Still nobody is shown up witht he solution. Come on guys! Please help.
Reply
#3
Solved: 11 Years, 4 Months, 3 Weeks ago
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?
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#4
Solved: 11 Years, 4 Months, 3 Weeks ago
hi,
Hearty welcome to QTP world.....

it would be great if you share the object spy screenshots so that we will analyse in depth.
Reply
#5
Solved: 11 Years, 4 Months, 3 Weeks ago
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?
Reply
#6
Solved: 11 Years, 4 Months, 3 Weeks ago
(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.

[Image: id.jpg]

Now is there anyway to handle this?
Reply
#7
Solved: 11 Years, 4 Months, 3 Weeks ago
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
  claimsid&i....
Next
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#8
Solved: 11 Years, 4 Months, 3 Weeks ago
Just to clarify, index no. won't be available in the spy. You can use them to identify objects using Descriptive Programming.
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#9
Solved: 11 Years, 4 Months, 3 Weeks ago
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
NewBulkInvoiceDetail:BulkInvoiceDetailScreen:BulkInvoiceItemsLV:1:BulkInvoiceItemsLV_ClaimNumber
NewBulkInvoiceDetail:BulkInvoiceDetailScreen:BulkInvoiceItemsLV:2:BulkInvoiceItemsLV_ClaimNumber

So This is how I am trying for the 1st one

Code:
For z= 0 to 1000

id1st="NewBulkInvoiceDetail:BulkInvoiceDetailScreen:BulkInvoiceItemsLV:"
id2nd=z
id3rd=":BulkInvoiceItemsLV_ClaimNumber"

ClaimNumberId=id1st&id2nd&id3rd

Browser("micclass:=Browser").Page("micclass:=Page").WebEdit("html id:=ClaimNumberId").Set ""
Next

Please help me out.
Reply
#10
Solved: 11 Years, 4 Months, 3 Weeks ago
Hi Guys! I could solve it. here are the codes

Code:
For z=0 to 999

Set Amount_Field=Description.Create
Amount_Field("Micclass").value="WebEdit"
Amount_FieldId_1stPortion="NewBulkInvoiceDetail:BulkInvoiceDetailScreen:BulkInvoiceItemsLV:"
Amount_FieldId_2ndPortion=":BulkInvoiceItemsLV_Amount"
Amount_Field_html_id=Amount_FieldId_1stPortion&z&Amount_FieldId_2ndPortion
Amount_Field("html id").value=Amount_Field_html_id

'Set Amount
Browser("ClaimCenterBrowser").Page("ClaimCenterPage").WebEdit(Amount_Field).Set Str_Amount
Browser("ClaimCenterBrowser").Page("ClaimCenterPage").Sync
Set ClaimNumber_ID=Nothing

Next

Thank you again
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Kendo UI Object Identification vasavi.vasavi 5 4,255 07-10-2020, 10:19 AM
Last Post: mariamattathil93@gmail.com
  webfile web object not identified at runtime in a java application saila123 1 2,839 02-11-2015, 08:23 PM
Last Post: Kirill
  Explain about object identification vikram 2 4,547 11-12-2014, 10:42 AM
Last Post: vinod123
  GMAIL Object Identification sidqtp 2 3,633 11-08-2014, 10:12 AM
Last Post: vinod123
  HAVING PROBLEM IN CREATING OBJECT OF TEST BATCH RUNNER mayankchauhan 0 3,451 04-04-2014, 05:29 PM
Last Post: mayankchauhan

Forum Jump:


Users browsing this thread: 1 Guest(s)