这发生在testcomplete版本9.20中,并针对firefox 19.0.2进行测试。在testcomplete中调用jquery时VBscript失败
第一个脚本文件称为test
,它包含以下行:
'USEUNIT CommonFunctions
Public Function test()
Call expandTree()
End Function
其他脚本文件被命名为CommonFunctions
具有这样的功能:
Public Function expandTree()
Set foo = Aliases.tree.contentDocument.Script.jQuery("li[data-nodeid='sites'] a.openClose").click()
End Function
当我运行脚本的自动化文件给出以下错误:
Microsoft VBscript runtime error.
Object doesn't support this property or method:"contentDocument.Script.jQuery(...).Click''
Error location:
Unit:"ContentSuite\Content\Script\CommonFunctions"
Line:3972 Coloumn2
如果将jquery放在同一个文件中,则不会发生同样的错误。也就是说,如果我运行这个它会正常工作,然后单击将很好地工作:
Public Function test()
Set foo = Aliases.tree.contentDocument.Script.jQuery("li[data-nodeid='sites'] a.openClose").click()
End Function
如果没有看到完整的代码,很难说。你能否编辑你的问题,并包含两个函数的代码? – Helen
添加更多的细节,谢谢你的评论 – user2295001
还没有足够的信息。请告诉我们TestComplete的版本以及您使用的浏览器。另外,如果直接从CommonFunctions单元运行,请检查是否可以执行expandTree例程。 –