| || |
I need to Verify items in a shopping bag and review order page.
Using Test Partner, Win XP, I am attempting to read the data from a dynamic table, to verify the contents of the table, eventually I will store that data in an array to verify the
correct items have been purchased, amounts and totals, etc.
Currently the only "property" I am able to identify is the "Index" when I attempt to create an object map for any of the cells within the table.
The table is a web page "shopping bag", the number of lines changes depending on the number of items ordered.
Are there any relatively steps to collect the data from a dynamic table?
Re: dynamic table
First - Create an Attach Name Profile in which the HTMLTD object has InnerText as its 'Always Use' Property.
Now.. you are going to use a combo of the Innertext, ElementID and Index properties. You need to find something in your app to key off of to represent a row, then move x element ID's to the left/right to get your innertext. This example will run on the qaforums.com page Testing Tools:
</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">'Array will hold the data
Dim theText(5) As String
'start loop to capture 5 rows
For X = 1 To 5
'use the ElementID property and Index
theID = HTMLImage("Caption='New Topics' Index=" & X).ElementID
theID = theID + 2 ' the Text we want is 2 elementIDs to the left
theText(X) = HTMLTD("ElementID=" & theID).InnerText
'InnerText is the property containing the text of a TD
'just to display what we captured
For X = 0 To 5
MsgBox "This row is for " & theText(X)
Next X</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">So I am keying off of the Lightbulb icon. you can key off of anything including other InnerText.