google搜索 站内搜索                 软件测试门户 | 软件测试培训 | 文章资料精选 | 软件测试论坛 | 测试解决方案 | 软件测试博客 | 测试招聘求职 
打印

[求助] 脚本不执行Click方法

脚本不执行Click方法


刚刚执行一个以前录的脚本,报错,提示对象找不到。
我发现了脚本中的此语句:
Browser("Scholarships 101").Page("Scholarships 101_5").Image("plus").Click
中的clikc方法并没有运行,也就是说脚本运行这个语句时候,似乎是直接跳过去了,对应页面,鼠标并没有点击“Plus”这个Image图标。
我尝试用虚拟对象代替Image,但行不通。。

这个问题该怎么解决啊???

TOP

1.在前面加wait 3试一下
2.改为Browser("Scholarships 101").Page("Scholarships 101_5").Image("plus").fireevent "onclick"
QQ:8607248
MSN:denisye@21cn.com

TOP

谢谢Denisye.
按照你说的做还是不行。。。
如果重新录的话,click方法是可以运行的。
不知道到底是什么问题。

TOP

Denisye 能不能介绍一下fireevent的相关知识啊。。谢谢!!sdlkfj3

TOP

啊?还是不行,是不是对象识别有问题导致的?
QTP的帮助文档是很不错的,其实最好的讲解就在你的QTP里面
我帖出来吧
object.FireEvent EventName, [x], [y], [BUTTON]

Argument Description
object A test object of type Image.
EventName Required. A String value.
The name of event to trigger. Available events: onchange, onclick, ondblclick, onblur, onfocus, onmousedown, onmouseup, onmouseover, onmouseout, onsubmit, onreset, onpropertychange.

x Optional. A Long value.
The x-coordinate, relative to the upper left corner of the object.

y Optional. A Long value.
The y-coordinate, relative to the upper left corner of the object.

BUTTON Optional. A pre-defined constant or number. See the Constants table, below.
The mouse button used to fire the object. Default = micLeftBtn (0).


The possible values for the BUTTON argument are:

Constant Value Description
  micLeftBtn 0 The left mouse button.  
  micRightBtn 1 The right mouse button.  
  micMiddleBtn 2 The middle mouse button.
QQ:8607248
MSN:denisye@21cn.com

TOP

谢谢Denisye拉!!

TOP

 
当前时区 GMT+8, 现在时间是 2008-11-23 06:13Copyright(C)上海博为峰软件技术有限公司 2001-2007 电话:021-64471599-8017
当您在访问网站、论坛及博客过程中遇到问题时可发送email:webmaster@51testing.com或发送论坛短信至管理员风在吹