51Testing软件测试论坛

标题: webradiogroup的选择问题 [打印本页]

作者: 爱喝可乐的蚊子    时间: 2008-9-2 23:19
标题: webradiogroup的选择问题
飞机订票web版,在选择航班时要用到webradiogroup,因为每次待选的webradiogroup的value值是不确定的,所以不知道怎么写这段代码。。。然后看到网上有关webradiogroup的使用,试了下用 Browser("Welcome: Mercury Tours").Page("Select a Flight: Mercury").WebRadioGroup("outFlight").Select ("#"&"2"),就可以成功的选到需要的webradiogroup了,但是这段代码我不懂,最后的这个Select ("#"&"2")里的"#"是什么意思??谢谢!!
作者: fengmingbao    时间: 2008-9-3 09:14
Index, 用来确定你要选 webradiogroup 里面的第几个 webradio
作者: 爱喝可乐的蚊子    时间: 2008-9-3 09:37
Select ("#"&"2")
这种写法是Vbscript里就有的,还是qtp特有的?
像#号有这种用法的话,还有没其他符号也有一些这种类似的特殊用法的啊?这要查哪方面的资料有介绍啊?谢谢
作者: 假装不在    时间: 2008-9-3 09:45
直接写select "#2"就可以了。
作者: 爱喝可乐的蚊子    时间: 2008-9-3 10:26
这个select里不能用变量么?我之前用下面这样可以正常通过,
browser("Browser").Page("Find a Flight: Mercury").WebList("passCount").Select ("#"&"3")
但是我定义个变量放进来,就运行不过了,
dim rownum
rownum = 2
browser("Browser").Page("Find a Flight: Mercury").WebList("passCount").Select ("#"&"rownum")
提示说:Cannot identify the specified item of the passCount object. Confirm that the specified item is included in the object's item collection
作者: 爱喝可乐的蚊子    时间: 2008-9-3 10:41
哦。可以了。
把browser("Browser").Page("Find a Flight: Mercury").WebList("passCount").Select ("#"&"rownum")
改成
browser("Browser").Page("Find a Flight: Mercury").WebList("passCount").Select "#"&rownum




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