51Testing软件测试论坛

标题: 这样的循环为什么执行时总跳过?谢谢 [打印本页]

作者: chenxi01032005    时间: 2009-8-28 19:20
标题: 这样的循环为什么执行时总跳过?谢谢
Dim buttonnum,buttonIndex
buttonnum=Cint(browser("管理后台").Page("管理后台").Frame("RightFrame").GetROProperty("Value"))
For buttonIndex=1 to buttonnum
Browser("管理后台").Page("管理后台").Frame("RightFrame").WebRadioGroup("buttonIndex").SetTOProperty "Value","buttonIndex"
Browser("管理后台").Page("管理后台").Frame("RightFrame").WebButton("确 定").Click
Browser("管理后台").Page("管理后台").Frame("RightFrame").Image("确定").Click
Next  页面上有多个单选按钮,我想让每个按钮都选1遍,但执行时,qtp总跳过这个循环,请问一下,是什么原因,谢谢!
作者: dabeixiong    时间: 2009-8-28 20:23
buttonIndex貌似是empty...
作者: ermine    时间: 2009-8-29 21:39
设置一下debug,看看buttonnum的值。
怀疑你在赋值buttonnum的时候,没有运行页面,buttonnum的值是0
所以不执行for 1 到0
作者: jarrey    时间: 2009-8-29 21:46
是buttonnum这里有问题!你看下吧BUTTONNUM直接赋值看看。




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