lutingting 2008-7-18 09:17
如何取出下拉菜单中的值
请教各位,如何依次取出下拉菜单中的值呢?
我把选择下拉菜单中的值参数话了
Browser("Firewall").Page("Firewall").Frame("data").WebList("modename").Select DataTable("Mode", dtLocalSheet)
并且用了for循环,可是总是取出的是同一个值,为什么呢
lutingting 2008-7-18 09:23
:hug:
lijian422202 2008-7-18 09:27
DATATABLE.SetCurrentRow 把这个加到你的FOR中去。
wiwimeier 2008-7-18 09:33
恩恩,你从DATATABLE中取的值只运行了第一行,没有运行下边的,出来的当然是同样的值了
zte_boy 2008-7-18 09:34
焦点没有移动,去看下datatable的方法
lutingting 2008-7-18 09:36
[quote]原帖由 [i]lijian422202[/i] 于 2008-7-18 09:27 发表 [url=http://bbs.51testing.com/redirect.php?goto=findpost&pid=1021707&ptid=120711][img]http://bbs.51testing.com/images/common/back.gif[/img][/url]
DATATABLE.SetCurrentRow 把这个加到你的FOR中去。 [/quote]
这个我加过了,可是还是不行
lutingting 2008-7-18 09:38
For k=1 to Browser("Firewall").Page("Firewall").Frame("data").WebList("modename").GetROProperty("items count")
DataTable.SetCurrentRow(k)
Browser("Firewall").Page("Firewall").Frame("data").WebList("modename").Click
Browser("Firewall").Page("Firewall").Frame("data").WebList("modename").GetItem(k)
Browser("Firewall").Page("Firewall").Frame("data").WebList("modename").Select DataTable("Mode", dtLocalSheet)
Browser("Firewall").Page("Firewall").Frame("data").WebList("modename").Click
Next
zhou840401 2008-7-18 09:44
DataTable.SetCurrentRow(k) 改成datatable.getsheet(sheetname).setcurrentrow(k) 试试 sheetname是你当前运行的sheetname
lijian422202 2008-7-18 09:54
For k=1 to Browser("Firewall").Page("Firewall").Frame("data").WebList("modename").GetROProperty("items count")
你用Sheet做的参数,为什么要用GetROProperty("items count")做循环?。。你先msgbox GetROProperty("items count")看看吧。
lutingting 2008-7-18 09:54
[quote]原帖由 [i]zhou840401[/i] 于 2008-7-18 09:44 发表 [url=http://bbs.51testing.com/redirect.php?goto=findpost&pid=1021814&ptid=120711][img]http://bbs.51testing.com/images/common/back.gif[/img][/url]
DataTable.SetCurrentRow(k) 改成datatable.getsheet(sheetname).setcurrentrow(k) 试试 sheetname是你当前运行的sheetname [/quote]
不行,提示:The DataTable.GetSheet operation failed. Specify the sheet using a text string or numerical index value.
lutingting 2008-7-18 10:02
[quote]原帖由 [i]lijian422202[/i] 于 2008-7-18 09:54 发表 [url=http://bbs.51testing.com/redirect.php?goto=findpost&pid=1021871&ptid=120711][img]http://bbs.51testing.com/images/common/back.gif[/img][/url]
For k=1 to Browser("Firewall").Page("Firewall").Frame("data").WebList("modename").GetROProperty("items count")
你用Sheet做的参数,为什么要用GetROProperty("items count")做循环?。。你先msgbox GetROPro ... [/quote]
这个只是取出菜单中值的个数确定需要循环的次数
lingxin5013 2008-7-18 12:57
msgbox Browser("用户注册").Page("用户注册").WebList("dpCity").GetROProperty("items count")
For i=1 to Browser("用户注册").Page("用户注册").WebList("dpCity").GetROProperty("items count")
datatable.GetSheet("Action1").setcurrentrow(i)
Browser("用户注册").Page("用户注册").WebList("dpCity").Select DataTable("p_Item", dtLocalSheet)
Browser("用户注册").Page("用户注册").WebList("dpCity").Click
Next
lingxin5013 2008-7-18 12:57
我自己实验了下 是可以通过的~! 你自己在看看!~
sally_0817 2008-7-25 13:55
最简单的方法,是使用 for循环加index的方法
sally_0817 2008-7-25 13:57
For i=0 To N
Browser("Firewall").Page("Firewall").Frame("data").WebList("modename").Select “#”&i
NEXT
zrg9399 2008-7-27 23:31
扩展一下,随即取下列列表的值
For i=0 To N
Browser("Firewall").Page("Firewall").Frame("data").WebList("modename").Select "#"&RandomNumber(0, n)
NEXT
zte_boy 2008-7-28 01:11
[quote]原帖由 [i]zrg9399[/i] 于 2008-7-27 23:31 发表 [url=http://bbs.51testing.com/redirect.php?goto=findpost&pid=1030653&ptid=120711][img]http://bbs.51testing.com/images/common/back.gif[/img][/url]
For i=0 To N
Browser("Firewall").Page("Firewall").Frame("data").WebList("modename").Select "#"&RandomNumber(0, n)
NEXT [/quote]
这样就行了吧
Randomize
i = CInt(n * Rnd)
Browser("Firewall").Page("Firewall").Frame("data").WebList("modename").Select "#"&i
[[i] 本帖最后由 zte_boy 于 2008-7-28 01:14 编辑 [/i]]
lushuishui 2008-7-31 17:52
回复 1# 的帖子
好像没这么难吧,Browser("Firewall").Page("Firewall").Frame("data").WebList("modename").getroproperty("value"),这样就可以取出下拉菜单中的值了吧
★斌斌※测试☆ 2008-7-31 21:26
恩,
不错!
又学到知识了!
★斌斌※测试☆ 2008-7-31 21:27
:victory:
页:
[1]