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

[求助] 为什么pushbotton click 失败呢,请大家帮忙

本主题由 fishy 于 2008-6-11 21:44 提升

为什么pushbotton click 失败呢,请大家帮忙


一段代码如下:
  dim frameurl as string
    frameurl="Type=Window;Caption=***** - Windows Internet Explorer;\;Type=Generic;Class=Shell DocObject    View;ClassIndex=1;\;Type=HTMLDocument;HTMLTitle=*****"
    StartBrowser "http://localhost:7001/test.html", "WindowTag=IE7"   
    Window SetContext, "WindowTag=IE7", ""
    Window WMaximize, "", ""   
'这里已经将焦点指向当前页面了啊
    Browser NewPage, frameurl, ""
    delayfor(3000)
    result=SQAGetproperty("Type=PushButton;Name=button;HTMLText=点击测试","value",a)
    SQAConsoleWrite str(result) & a   
    PushButton Click, Type=PushButton;Name=button;HTMLText=点击测试"-----问题出在这里,必须指明控件绝对路径,改成
  PushButton Click, frameurl & ";\;Type=PushButton;Name=button;HTMLText=点击测试"就正常了,而SQAGetproperty不用加绝对路径能正常获取属性,这是为什么呢,我不想在每个控件前面都加上frameurl这样来操作

[ 本帖最后由 testlike 于 2008-6-10 14:31 编辑 ]

TOP

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