liyf51 发表于 2008-8-28 11:04:12

获取行数

我用MERCURY自带的订票系统去练习,想取它的行数,但是不知道用什么函数取,请大家帮忙,那个网页我已经截图了,放在附件里。
这个是我写得:
itemcount = browser("Welcome: Mercury Tours").Page("Select a Flight: Mercury").WebRadioGroup("outFlight").GetROProperty("items count")
selectitem = randomnumber(1,itemcount)
browser("Welcome: Mercury Tours").Page("Select a Flight: Mercury").WebRadioGroup("outFlight").Selectselectitem
QTP报:Cannot identify the specified item of the outFlight object. Confirm that the specified item is included in the object's item collection.

liyf51 发表于 2008-8-28 11:05:59

我怎么可以把截到的图传上来呢

zte_boy 发表于 2008-8-28 11:22:08

selectitem 是index
object.select "#"&selectitem

liyf51 发表于 2008-9-2 11:41:53

谢谢楼上这位朋友,但是我试了,还是不行,我这样写了脚本,想随机取一行作为选择项:
NumOfItems = browser("Welcome: Mercury Tours").Page("Select a Flight: Mercury").WebRadioGroup("outFlight").GetROProperty("Items Count")
randomcount = randomnumber(1,NumOfItems)
Browser("Welcome: Mercury Tours").Page("Select a Flight:
Mercury").WebRadioGroup("outFlight").Select randomcount

QTP执行后报:Cannot identify the specified item of the outFlight object. Confirm that the specified item is included in the object's item collection.
请大家帮帮忙:handshake

fengmingbao 发表于 2008-9-2 11:56:53

temystr = Browser(“AA").Page(“BB").Frame("rightFrame_4").WebRadioGroup("ID").GetROProperty("all items")

tempcount = Browser(“AA").Page(“BB").Frame("rightFrame_4").WebRadioGroup("ID").GetROProperty("items count")

Record1 = Split(tempstr, ";", -1, 1)

requiredRow = randomnumber(0, tempcount-1)

Record = Record1(requiredRow)

Browser(“AA").Page(“BB").Frame("CC").WebRadioGroup("ID").Select Record

liyf51 发表于 2008-9-2 14:00:34

谢谢楼上这位朋友,OK啦:)
页: [1]
查看完整版本: 获取行数