0
SystemUtil.Run "C:\Program Files\MozillaFirefox\firefox.exe","https://accounts.google.com/ServiceLogin?service=mail&passive=true&rm=false&continue=http://mail.google.com/mail/&scc=1&ltmpl=default&ltmplcache=2"
Browser ("text=Google - Mozilla Firefox").Page("text=Google - Mozilla Firefox").WebEdit("text=Google - Mozilla Firefox").Set "Ram"
Browser ("text=Google - Mozilla Firefox").Page("text=Google - Mozilla Firefox").WebButton("text=Google - Mozilla Firefox").Click

我正在使用快速测试专业版,我想在 mozilla 中打开 google 并想搜索“Ram”。当我执行此代码时,它显示 Object not found in object repository 但这是描述性编程,无需在本地对象中添加对象存储库。

4

1 回答 1

1

您应该使用 qtp 中的 object spy 来识别正确的对象属性。此处的 Browser 对象没有 text 属性,而是您应该使用 title 作为标识属性。

此外,您提供的网址似乎指向 Gmail 而不是 Google 搜索。

这是IE的示例,希望对您有所帮助

SystemUtil.Run "iexplore.exe", "www.google.com"
Browser("title:=Google").Page("title:=Google").WebEdit("name:=q").Set ("Ram")
Browser("title:=Google").Page("title:=Google").WebEdit("name:=q").Submit
于 2013-07-01T14:29:03.000 回答