标题: 为什么我取不到下拉框内的值呢? [打印本页] 作者: qingchunjun 时间: 2005-10-20 09:47 标题: 为什么我取不到下拉框内的值呢? 各位达人,我现在想取得一个下拉框内的所有值,代码如下:
Sub Main
Dim Result As Integer
dim varStr as string
'Initially Recorded: 2005-10-20 9:21:29
'Script Name: temp3
StartBrowser "http://10.200.1.66", "WindowTag=web"
Window SetTestContext, "Caption=Agile Advantage - Microsoft Internet Explorer", ""
' Browser SetFrame,"Type=HTMLFrame;HTMLId=RightPane",""
' Browser NewPage,"HTMLTitle=Select SubClass And Number",""
' Result = ComboBoxVP (CompareProperties, "Type=ComboBox;Name=subClassId", "VP=Object Properties3")
Window ResetTestContext, "", ""
Result=SQAGetProperty("Caption=Agile Advantage - Microsoft Internet Explorer;\;Type=HTMLFrame;HTMLId=RightPane;\;Type=ComboBox;Name=subClassId","innerText", str1)作者: qingchunjun 时间: 2005-10-24 15:12 标题: 问题解决了 现在该问题已经解决了。我参考了robot help中的ComboBoxVP函数附带的一个example后,照着上面的写法试了一下,果然成功了。那个example中关于验证点的语句是这样写的:Result = ComboBoxVP (CompareData, "Type=HTMLFrame;HTMLId=Main;\;Type=ComboBox; Name=Selectlist", "VP=SELECTVP1;Wait=2,30")
大家注意看,该句的"Type=HTMLFrame;HTMLId=Main;\;Type=ComboBox; Name=Selectlist"-------它同样是定位一个frame内的combobox控件,但其并没有写第一个“HTMLTitle=”的内容,所以我联想到我这样的情况是不是同样也可以这样进行定位。结果我修改我上午的代码如下:
Sub Main
Dim Result As Integer
dim strText as variant
'Initially Recorded: 2005-10-24 9:55:07
'Script Name: temp4
StartBrowser "http://10.200.1.66/index.html", "WindowTag=web"