查看完整版本: 还是对弹出的网页对话框的识别问题

Simatu 2008-5-8 17:11

还是对弹出的网页对话框的识别问题

在对报表进行“打回”操作时, 系统会新打开一网页窗口,要求输入打回原因,并提交

但是QTP对这个新打开的网页窗口无法识别。

想起上此时间设置窗口中的解决方法: 通过object.value对时间进行设定,而非通过录制
那么我要现在要怎么对“提交”按钮操作才能达到‘点击’的效果?

[[i] 本帖最后由 Simatu 于 2008-5-8 17:12 编辑 [/i]]

Simatu 2008-5-8 17:27

附上操作界面

[[i] 本帖最后由 Simatu 于 2008-5-8 17:28 编辑 [/i]]

Simatu 2008-5-8 17:29

还有报错信息:

Cannot identify the object "提交" (of class WebButton). Verify that this object's properties match an object currently displayed in your application.

[[i] 本帖最后由 Simatu 于 2008-5-8 17:32 编辑 [/i]]

zte_boy 2008-5-8 19:10

先用Tostring下,看看是否获取到了父对象

Simatu 2008-5-9 09:22

[quote]原帖由 [i]zte_boy[/i] 于 2008-5-8 19:10 发表 [url=http://bbs.51testing.com/redirect.php?goto=findpost&pid=964772&ptid=114231][img]http://bbs.51testing.com/images/common/back.gif[/img][/url]
先用Tostring下,看看是否获取到了父对象 [/quote]

新打开了一个page,看图示:

zhou840401 2008-5-9 11:34

打开的页面是在原来的browser显示的,还是新打开一个browser的.

Simatu 2008-5-9 11:39

[quote]原帖由 [i]zhou840401[/i] 于 2008-5-9 11:34 发表 [url=http://bbs.51testing.com/redirect.php?goto=findpost&pid=965134&ptid=114231][img]http://bbs.51testing.com/images/common/back.gif[/img][/url]
打开的页面是在原来的browser显示的,还是新打开一个browser的. [/quote]


是新打开一个Browser的

sayusayme 2008-5-12 11:01

Cannot identify the object "提交" (of class WebButton). Verify that this object's properties match an object currently displayed in your application.
=========
这样的报错的提示信息我也经常遇到
是由于我的对象经常跑到窗口外面去了,或者其他的东西挡住了,看不见
比如,回放点击“确定”按钮时,窗口只显示一半,这个按钮没有显示出来,回放的时候就报错,和上面一样的

楼主的错误我也不清楚,希望我的经历对你有帮助

zte_boy 2008-5-12 11:25

因为这个页面上只有一个按钮
试试这个代码:

set ObjButton = Browser("xx").Page("xx").Childobjects("WebButton")
NumberOfObjButton = ObjButton.count
ObjButton(NumberOfObjButton).Click

zte_boy 2008-5-12 11:25

最好先在这个界面获取一下焦点

李靖之 2008-5-12 11:31

偶看你获取的对象好像是WebTable下的WebButton
可是看你的出错的截图!Browser().page().webbutton()
是不是这个问题呢?

Simatu 2008-5-12 13:45

补充5#的回复

在Run time中获取的对象树多了一个Browser

Simatu 2008-5-12 13:47

[quote]原帖由 [i]李靖之[/i] 于 2008-5-12 11:31 发表 [url=http://bbs.51testing.com/redirect.php?goto=findpost&pid=966459&ptid=114231][img]http://bbs.51testing.com/images/common/back.gif[/img][/url]
偶看你获取的对象好像是WebTable下的WebButton
可是看你的出错的截图!Browser().page().webbutton()
是不是这个问题呢? [/quote]

没错阿,出错截图中也是WebButton

Simatu 2008-5-12 14:12

[quote]原帖由 [i]zte_boy[/i] 于 2008-5-12 11:25 发表 [url=http://bbs.51testing.com/redirect.php?goto=findpost&pid=966449&ptid=114231][img]http://bbs.51testing.com/images/common/back.gif[/img][/url]
因为这个页面上只有一个按钮
试试这个代码:

set ObjButton = Browser("xx").Page("xx").Childobjects("WebButton")
NumberOfObjButton = ObjButton.count
ObjButton(NumberOfObjButton).Click [/quote]

这个方法我试了一下后提示: 类型不匹配: 'Browser(...).Page(...).Childobjects'

李靖之 2008-5-12 15:58

是不是可以试试
set objbutton = browser("xx").page("xx").chindobjects("WebTable)
呢?

walker1020 2008-5-13 21:33

[quote]原帖由 [i]李靖之[/i] 于 2008-5-12 15:58 发表 [url=http://bbs.51testing.com/redirect.php?goto=findpost&pid=966802&ptid=114231][img]http://bbs.51testing.com/images/common/back.gif[/img][/url]
是不是可以试试
set objbutton = browser("xx").page("xx").chindobjects("WebTable)
呢? [/quote]
是否是
set objbutton = browser("xx").page("xx").chindobjects("WebTable“)?

即使这样写,恐怕也有问题

tianwei 2008-5-19 11:14

我觉得10楼说的对,录制的时候点点这个dialog,(系统会有activate的相关语句,就是激活当前窗口,回放的时候注释掉这个语句),然后再点这个button就应该可以了。

zte_boy 2008-5-19 11:34

这种问题没有环境调试很难定位问题啊,呵呵
大家都只是推测原因而已
页: [1]
查看完整版本: 还是对弹出的网页对话框的识别问题