51Testing软件测试论坛

标题: 获取行数 [打印本页]

作者: liyf51    时间: 2008-8-28 11:04
标题: 获取行数
我用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").Select  selectitem
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
我怎么可以把截到的图传上来呢
作者: zte_boy    时间: 2008-8-28 11:22
selectitem 是index
object.select "#"&selectitem
作者: liyf51    时间: 2008-9-2 11:41
谢谢楼上这位朋友,但是我试了,还是不行,我这样写了脚本,想随机取一行作为选择项:
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.
请大家帮帮忙
作者: fengmingbao    时间: 2008-9-2 11:56
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
谢谢楼上这位朋友,OK啦  




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2