tags:

views:

43

answers:

1

What I have is a table of dollar amounts, some of which are links. Example:

$0.00
$1,000.00
$1.00

How do I say this most succinctly in QTP-land?

Set desCurrencyString = Description.Create  
desCurrencyString("micclass").value = NOT "Link"

I suppose I could just use a boolean value to see where the link is and somehow capture the other parts of the list, possibly like this:

Set desCurrencyString = Description.Create
desCurrencyString("text").RegularExpression = True
desCurrencyString("text").value = "\$[0-9]*"

Set arrCurrencyStrings = Page.ChildObjects(desCurrencyString)

desCurrencyString("micclass").value = "Link"

arrCurrencyStrings.Remove(desCurrencyString) 'Or something, will be editing this line later
A: 

Simply loop through a WebTable.
To get cell text, use GetCellData(Row, Col) method of WebTable object.
To get a child object contained in a cell, use ChildItem(Row, Col, MicClass, intIndex) method of WebTable object.

Neither table rows, nor cells, spans, divs, etc. can be returned by ChildObjects function as they are not truly GUI object classes. (Though, if you would need it very much you could define such custom objects, but you'd have to manually set them up in Object Repository Manager).

Albert Gareev