j44jj44j 发表于 2008-11-25 17:56:47

初学描述性编程求助!

SystemUtil.Run "iexplore.exe","","","open"
Browser("title:=自定义您的位置").Navigate "http://www.google.com/"
为什么不行,应该怎么写

raymond.tang 发表于 2008-11-25 22:49:42

You should tell us what error you met first, then we can investigate where the problem should be.
But I think your problem shoud be not enough attribute to allow QTP to recognize the UI object unique.

j44jj44j 发表于 2008-11-26 09:08:22

我就是想让系统打开IE,然后跳转到google,应该怎么写?

sangjf 发表于 2008-11-26 09:20:31

SystemUtil.Run "iexplore.exe","","","open"
Browser("title:=.*").Navigate "http://www.google.com/"
这样应该就好了

kou_dou 发表于 2008-11-26 11:29:58

SystemUtil.Run "iexplore.exe","","","open"

url=".*"

Browser("title:="&url).Navigate( "http://www.google.com/")

试过了,没问题

TEST_HUAN 发表于 2008-11-26 12:27:23

描叙性编程,必须取得唯一值。title总是唯一的

TEST_HUAN 发表于 2008-11-26 12:30:59

原帖由 kou_dou 于 2008-11-26 11:29 发表 http://bbs.51testing.com/images/common/back.gif
SystemUtil.Run "iexplore.exe","","","open"

url=".*"

Browser("title:="&url).Navigate( "http://www.google.com/")

试过了,没问题

怎么不行?
提示:General run error.

Line (18): "Browser("title:="&url).Navigate( "http://www.google.com/")".

j44jj44j 发表于 2008-11-26 12:31:17

按照楼上两位的试了试,运行结果没有显示Fail,但是IE也没有跳转到google,附图

TEST_HUAN 发表于 2008-11-26 13:13:07

奇怪,我这儿出错

j44jj44j 发表于 2008-11-26 14:58:59

TEST_HUAN ,你把浏览器窗口都关掉,再试试

没有蛀牙 发表于 2008-11-26 15:34:31

SystemUtil.Run "iexplore.exe","http://www.google.com/",3

j44jj44j 发表于 2008-11-26 19:33:24

原帖由 没有蛀牙 于 2008-11-26 15:34 发表 http://bbs.51testing.com/images/common/back.gif
SystemUtil.Run "iexplore.exe","http://www.google.com/",3
这是直接打开吧,要想跳转到某个网页怎么写?

j44jj44j 发表于 2008-11-28 16:52:37

加上等待时间就好了
SystemUtil.Run "iexplore.exe","","","open"
wait 5
Browser("title:=.*").Navigate "http://www.google.com/"

tracyd 发表于 2008-11-29 06:36:31

原帖由 没有蛀牙 于 2008-11-26 15:34 发表 http://bbs.51testing.com/images/common/back.gif
SystemUtil.Run "iexplore.exe","http://www.google.com/",3

我用的是QTP9.5, 除了这一个可以直接link到google上,其他的都出错,都说找不到object:

j44jj44j 发表于 2008-12-1 09:31:51

tracyd,提示的意思是说匹配到了多于一个的对象,也就是说你打开了一个以上的IE窗口,你把IE都关掉应该就可以了。

tracyd 发表于 2008-12-3 01:22:53

我又试了试,的确是因为我一直开着51testing.com的网页

所有的网页都关掉就成功了。谢谢!
页: [1]
查看完整版本: 初学描述性编程求助!