如果我在驱动程序脚本中使用相同的代码,则可以正常工作,但是,当我使用函数调用它时,它将引发错误,提示输入不匹配浏览器
函数调用:validateTextonPage "Edit delivery","Edit delivery", "delivery#"
Function validateTextonPage (browser, page, comptext)
'print browser
'print page
mytext = Browser("title:=" & browser).Page("title:=" & page).GetROProperty("innertext")
'print mytext
strmatch = Instr(1, mytext, comptext)
if strmatch <> 0 then
Msgbox "Text found"
else
Msgbox "Not found"
End If
End Function
Vbscript在SeNsiTiVE中是大小写,这意味着您browser
参数将覆盖Browser
测试对象类型。尝试将browser
和page
重命名为browserTitle
和pageTitle
。