Result = EditBoxVP (CompareNumeric, "Type=EditBox;Name=TextBox1", "VP=Alphanumeric;Value=" & a)
回复 21# 的帖子
第一个验证点通过了,但是第二个验证点中Result = EditBoxVP (CompareNumeric, "Type=EditBox;Name=TextBox1", "VP=Alphanumeric;Value="&a)
这段在testmanager中出现"playback warning"导致测试错误,请问我在代码中是否设计的不符合要求? 我的datapool是
a
2
4 问题出在哪? 楼主,我完全照你的做法做了一个windows自带计算器的例子给你希望你能好好的研究一下,不难的,相信研究后对你很有用。另外真是佩服楼主的精神。自己一点都不想去想想的吗?
我的数据池数据是一列字段
2
6
8
脚本代码:
'$Include "sqautil.sbh"
Sub Main
Dim Result As Integer
'Initially Recorded: 2009-2-1816:47:20
'Script Name: test3
Dim dp_id,dp_Result as long
Dim Str1 as string
Dim i as integer
dp_id = SQADatapoolOpen ("51test", FALSE, SQA_DP_SEQUENTIAL, FALSE)
call SQADatapoolFetch (dp_id)
call SQADatapoolValue(dp_id,1,Str1)
' call SQADatapoolRewind (dp_id)
msgbox Str1
Window SetContext, "Caption=计算器", ""
PushButton Click, "Text=1"
PushButton Click, "Text=+"
PushButton Click, "Text=1"
PushButton Click, "Text=="
Window SetTestContext, "Caption=计算器", ""
Result = EditBoxVP (CompareNumeric, "ObjectIndex=1", "VP=Alphanumeric;Value=" & Str1)
Window ResetTestContext, "", ""
if Result=0 then
sqalogmessage sqaWarning,"计算机验证失败",""
end if
msgbox Result
call SQADatapoolFetch (dp_id)
call SQADatapoolValue(dp_id,1,Str1)
msgbox Str1
Window SetContext, "Caption=计算器", ""
PushButton Click, "Text=3"
PushButton Click, "Text=+"
PushButton Click, "Text=3"
PushButton Click, "Text=="
Window SetTestContext, "Caption=计算器", ""
Result = EditBoxVP (CompareNumeric, "ObjectIndex=1", "VP=Alphanumeric;Value=" & Str1)
Window ResetTestContext, "", ""
if Result=0 then
sqalogmessage sqaWarning,"计算机验证失败",""
end if
msgbox Result
dp_Result = SQADatapoolClose (dp_id)
end sub
回复 25# 的帖子
这个脚本被我放在一边很长时间一直没空去弄(学校规定的作业,并不是出于我本身意愿。我是学网站编程,测试以及robot这个工具还是第一次接触),而且这个脚本的功能我也清楚很基础,可是我至今我能查到的资料包括软件再带的help中没有关于这点问题的例子和说明,搞的我也不知道从哪里开始下手。不过还是谢谢你肯花时间帮我搞清这问题! :) 遇到新问题了。。。。。在比较字母时(验证点的第二种),Result = EditBoxVP (CompareText, "Type=EditBox;Name=TextBox1", "VP=Alphanumeric;Type=CaseInsensitive")基准值为error!
可这种验证点没有value值怎么比较?还是说是与数字的值比较机制不同?
页:
1
[2]