类型不匹配尝试将浏览器和页面标题传递给功能时的浏览器错误-UFT

问题描述 投票:2回答:1

如果我在驱动程序脚本中使用相同的代码,则可以正常工作,但是,当我使用函数调用它时,它将引发错误,提示输入不匹配浏览器

函数调用: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 qtp
1个回答
0
投票

Vbscript在SeNsiTiVE中是大小写,这意味着您browser参数将覆盖Browser测试对象类型。尝试将browserpage重命名为browserTitlepageTitle

© www.soinside.com 2019 - 2024. All rights reserved.