开发者

In QTP, is it possible to have an anti-description?

开发者 https://www.devze.com 2023-01-09 02:28 出处:网络
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?

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(desCur开发者_开发技巧rencyString)

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

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


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消