51Testing软件测试论坛

标题: 保存radiobutton的值 [打印本页]

作者: angelia_liu    时间: 2008-10-27 18:00
标题: 保存radiobutton的值
RadioItems = Browser("Welcome: Mercury Tours").Page("Select a Flight: Mercury").WebRadioGroup("outFlight").GetROProperty("all items")

RadioContent = split(RadioItems,";")

i = randomnumber(0,ubound(RadioContent))

Browser("Welcome: Mercury Tours").Page("Select a Flight: Mercury").WebRadioGroup("outFlight").Select RadioContent(i)

如上代码所示,我选择了一个radiobutton,在后面我将用到这个radionbutton,请问我该如何保荐这个值呢?
我想进行把他保荐在参数里面,但是提示"未找到已命名参数".请高人指教如何对这个编写代码或者用datetable也行
Parameter("OFlight") = Browser("Welcome: Mercury Tours").Page("Select a Flight: Mercury").WebRadioGroup("outFlight").GetROProperty("value")
作者: zte_boy    时间: 2008-10-28 00:04
尽量避免使用数组,利用items count就可以了
先获取items count,然后用个循环处理
NumberOfRadioButton = Object.GetROProperty("items count")
For j = 0 to NumberOfRadioButton - 1
               Browser("发送短信").Page("发送短信").WebRadioGroup("smsType").select "#"&j
next
作者: angelia_liu    时间: 2008-10-28 09:35
标题: 回复 2# 的帖子
我也试过用items count,但是到后面会出错,提示"Cannot identify the specified item of the outFlight object. Confirm that the specified item is included in the object's item collection."

我现在想做的是把我选择的这个选项保存起来后面用来检查.
作者: angelia_liu    时间: 2008-10-28 13:40
有人吗?
作者: hsjzfling    时间: 2008-10-28 15:22
1. Parameter("OFlight") = Browser("Welcome: Mercury Tours").Page("Select a Flight: Mercury").WebRadioGroup("outFlight").GetROProperty("value")
这句报错是说你的Parameter("OFlight") 找不到,而跟WebRadioGroup无关

2. 我也试过用items count,但是到后面会出错,提示"Cannot identify the specified item of the outFlight object. Confirm that the specified item is included in the object's item collection."
这个报错的时候debug看下你select的item的值是多少,然后再逐步看从哪里开始debug看到的值和预期的值不一致,找到错在哪里

BTW, LZ跟刘叶叶有什么关系么~~
作者: TEST_HUAN    时间: 2008-10-28 16:54
MARK
作者: angelia_liu    时间: 2008-10-29 09:23
标题: 回复 5# 的帖子
Parameter("OFlight") 找不到,那要怎么样才可以找到呢?
作者: hsjzfling    时间: 2008-10-29 11:12
就是说Parameter("OFlight")这个参数未定义,这个叫OFlight的参数并不存在于Action或Test的Parameter列表中
作者: angelia_liu    时间: 2008-10-29 16:08
标题: 回复 8# 的帖子
但是我定义了呀
作者: angelia_liu    时间: 2008-10-30 09:23





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