我正在尝试使用Browsers.Item(btChrome).Run(datavalue)启动一个页面,并检查该页面是否包含我要查找的特定单词字符串。并且出现错误所需的对象:“浏览器” 。我很困惑,因为我正在关注https://support.smartbear.com/testcomplete/docs/app-testing/web/general/examples/checking-specific-text.html的教程。有人可以指出我的代码出了什么问题吗?
Sub Test(datavalue)
Dim browser, page, str, Obj
Browsers.Item(btChrome).Run(datavalue) 'datavalue is an url
Set browser = Sys.Browser("*")
Set page = browser.Page("*")
str = "*Dashboard*"
If browser.ObjectIdentifier = "chrome" Then
Call aqObject.CheckProperty(body, "innerText", cmpContains, str, False)
Else
Call aqObject.CheckProperty(body, "textContent", cmpContains, str, False)
End If
End Sub