Python论坛  - 讨论区

标题:[python-chinese] 求助:pamie中怎样处理中文标题的弹出对话框?

2006年04月17日 星期一 20:00

xianglong yin yinxianglong at gmail.com
Mon Apr 17 20:00:58 HKT 2006

 我在用pamie做网页表单测试的时候,遇到了需要处理弹出对话框,比如 "证书选择"、"选择文件"、"保存文件"的对话框。
我根据网上的一些资料采用winGuiAuto的方法 findTopWindow(wantedText="证书选择")来处理,老是失败。
而且我也采用转码的方式:
findTopWindow(wantedText=u"证书选择")
 findTopWindow(wantedText=r"证书选择")
 findTopWindow(wantedText=unicode("证书选择","cp936"))
等等转码方式都试过了,依然不能 通过findTopWindow来找到弹出窗口。

希望大家能给予我帮助,感激不尽!!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060417/81569b10/attachment.htm

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年04月18日 星期二 21:01

tocer tocer.deng at gmail.com
Tue Apr 18 21:01:40 HKT 2006

代码贴出来看看

在 06-4-17,xianglong yin<yinxianglong at gmail.com> 写道:
>
>
> 我在用pamie做网页表单测试的时候,遇到了需要处理弹出对话框,比如
> "证书选择"、"选择文件"、"保存文件"的对话框。
> 我根据网上的一些资料采用winGuiAuto的方法
> findTopWindow(wantedText="证书选择")来处理,老是失败。
> 而且我也采用转码的方式:
> findTopWindow(wantedText=u"证书选择")
>
> findTopWindow(wantedText=r"证书选择")
>
> findTopWindow(wantedText=unicode("证书选择","cp936"))
> 等等转码方式都试过了,依然不能 通过findTopWindow来找到弹出窗口。
>
> 希望大家能给予我帮助,感激不尽!!
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to
> python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to
> python-chinese-request at lists.python.cn
> Detail Info:
> http://python.cn/mailman/listinfo/python-chinese
>
>

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年04月19日 星期三 08:51

xianglong yin yinxianglong at gmail.com
Wed Apr 19 08:51:19 HKT 2006

我的代码是这样的
    import cPAMIE, winGuiAuto

    ie = cPAMIE.PAMIE()
    wga = winGuiAuto
    # 登录
    ie.navigate("http://192.168.28.130:10003/exp")
    ie.textBoxSet("{actionForm.userName}", "0102")
    ie.textBoxSet("{actionForm.userPwd}", "01020000")
    ie.textBoxSet("{actionForm.instCode}", "01020000")
    #点击下面按钮"I1"之后,有一个"证书选择"的对话框弹出来,就需要点击对话框上的确定
    ie.buttonClick("I1")
    # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。
    hwnd = wga.findTopWindow(wantedText="证书选择")#
    okButton = wga.findControl(hwnd, wantedClass="Button", wantedText="确定")
    clickButton(okButton)

请帮我找找问题,多谢各位!



在06-4-18,tocer <tocer.deng at gmail.com> 写道:
>
> 代码贴出来看看
>
> 在 06-4-17,xianglong yin<yinxianglong at gmail.com> 写道:
> >
> >
> > 我在用pamie做网页表单测试的时候,遇到了需要处理弹出对话框,比如
> > "证书选择"、"选择文件"、"保存文件"的对话框。
> > 我根据网上的一些资料采用winGuiAuto的方法
> > findTopWindow(wantedText="证书选择")来处理,老是失败。
> > 而且我也采用转码的方式:
> > findTopWindow(wantedText=u"证书选择")
> >
> > findTopWindow(wantedText=r"证书选择")
> >
> > findTopWindow(wantedText=unicode("证书选择","cp936"))
> > 等等转码方式都试过了,依然不能 通过findTopWindow来找到弹出窗口。
> >
> > 希望大家能给予我帮助,感激不尽!!
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese at lists.python.cn
> > Subscribe: send subscribe to
> > python-chinese-request at lists.python.cn
> > Unsubscribe: send unsubscribe to
> > python-chinese-request at lists.python.cn
> > Detail Info:
> > http://python.cn/mailman/listinfo/python-chinese
> >
> >
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060419/95735144/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年04月19日 星期三 18:13

tocer tocer.deng at gmail.com
Wed Apr 19 18:13:51 HKT 2006

从程序上看不出什么错误,你那个网页是内部网页么?有没有相似的网站,我上去试试?

在 06-4-19,xianglong yin<yinxianglong at gmail.com> 写道:
>
> 我的代码是这样的
>     import cPAMIE, winGuiAuto
>
>     ie = cPAMIE.PAMIE()
>     wga = winGuiAuto
>     # 登录
>     ie.navigate("http://192.168.28.130:10003/exp")
>     ie.textBoxSet("{actionForm.userName }", "0102")
>     ie.textBoxSet("{actionForm.userPwd}", "01020000")
>     ie.textBoxSet("{actionForm.instCode}", "01020000")
>     #点击下面按钮"I1"之后,有一个"证书选择"的对话框弹出来,就需要点击对话框上的确定
>     ie.buttonClick("I1")
>     # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。
>     hwnd = wga.findTopWindow(wantedText="证书选择")#
>     okButton = wga.findControl(hwnd, wantedClass="Button", wantedText="确定")
>     clickButton(okButton)
>
> 请帮我找找问题,多谢各位!
>
>
>
> 在06-4-18,tocer <tocer.deng at gmail.com> 写道:
> > 代码贴出来看看
> >
> > 在 06-4-17,xianglong yin<yinxianglong at gmail.com > 写道:
> > >
> > >
> > > 我在用pamie做网页表单测试的时候,遇到了需要处理弹出对话框,比如
> > > "证书选择"、"选择文件"、"保存文件"的对话框。
> > > 我根据网上的一些资料采用winGuiAuto的方法
> > > findTopWindow(wantedText="证书选择")来处理,老是失败。
> > > 而且我也采用转码的方式:
> > > findTopWindow(wantedText=u"证书选择")
> > >
> > > findTopWindow(wantedText=r"证书选择")
> > >
> > > findTopWindow(wantedText=unicode("证书选择","cp936"))
> > > 等等转码方式都试过了,依然不能 通过findTopWindow来找到弹出窗口。
> > >
> > > 希望大家能给予我帮助,感激不尽!!
> > > _______________________________________________
> > > python-chinese
> > > Post: send python-chinese at lists.python.cn
> > > Subscribe: send subscribe to
> > > python-chinese-request at lists.python.cn
> > > Unsubscribe: send unsubscribe to
> > > python-chinese-request at lists.python.cn
> > > Detail Info:
> > > http://python.cn/mailman/listinfo/python-chinese
> > >
> > >
> >
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese at lists.python.cn
> > Subscribe: send subscribe to
> python-chinese-request at lists.python.cn
> > Unsubscribe: send unsubscribe to
> python-chinese-request at lists.python.cn
> > Detail Info:
> http://python.cn/mailman/listinfo/python-chinese
> >
> >
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to
> python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to
> python-chinese-request at lists.python.cn
> Detail Info:
> http://python.cn/mailman/listinfo/python-chinese
>
>

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年04月19日 星期三 18:36

xianglong yin yinxianglong at gmail.com
Wed Apr 19 18:36:44 HKT 2006

对啊,内部网页。这个内部的网页是需要安装证书这些,很麻烦的。

但是我在用pamie测试文件浏览对话框时也不能找到,
例如:
网页文件(1.html):
python代码如下: import cPAMIE, winGuiAuto ie = cPAMIE.PAMIE() wga = winGuiAuto # 登录 ie.navigate("d:\\1.html") ie.buttonClick("install") #点击上面的按钮"install"之后,有一个"文件选择"的对话框弹出来,就需要控制对话框上的控件了 # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。 hwnd = wga.findTopWindow(wantedText="选择文件") # 点击取消按钮 cancelButton = wga.findControl(hwnd, wantedClass="Button", wantedText="取消") clickButton(cancelButton ) 这段python代码不能找到 "选择文件"的对话框。 在06-4-19,tocer <tocer.deng at gmail.com> 写道: > > 从程序上看不出什么错误,你那个网页是内部网页么?有没有相似的网站,我上去试试? > > 在 06-4-19,xianglong yin<yinxianglong at gmail.com> 写道: > > > > 我的代码是这样的 > > import cPAMIE, winGuiAuto > > > > ie = cPAMIE.PAMIE() > > wga = winGuiAuto > > # 登录 > > ie.navigate("http://192.168.28.130:10003/exp") > > ie.textBoxSet("{actionForm.userName }", "0102") > > ie.textBoxSet("{actionForm.userPwd}", "01020000") > > ie.textBoxSet("{actionForm.instCode}", "01020000") > > #点击下面按钮"I1"之后,有一个"证书选择"的对话框弹出来,就需要点击对话框上的确定 > > ie.buttonClick("I1") > > # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。 > > hwnd = wga.findTopWindow(wantedText="证书选择")# > > okButton = wga.findControl(hwnd, wantedClass="Button", > wantedText="确定") > > clickButton(okButton) > > > > 请帮我找找问题,多谢各位! > > > > > > > > 在06-4-18,tocer <tocer.deng at gmail.com> 写道: > > > 代码贴出来看看 > > > > > > 在 06-4-17,xianglong yin<yinxianglong at gmail.com > 写道: > > > > > > > > > > > > 我在用pamie做网页表单测试的时候,遇到了需要处理弹出对话框,比如 > > > > "证书选择"、"选择文件"、"保存文件"的对话框。 > > > > 我根据网上的一些资料采用winGuiAuto的方法 > > > > findTopWindow(wantedText="证书选择")来处理,老是失败。 > > > > 而且我也采用转码的方式: > > > > findTopWindow(wantedText=u"证书选择") > > > > > > > > findTopWindow(wantedText=r"证书选择") > > > > > > > > findTopWindow(wantedText=unicode("证书选择","cp936")) > > > > 等等转码方式都试过了,依然不能 通过findTopWindow来找到弹出窗口。 > > > > > > > > 希望大家能给予我帮助,感激不尽!! > > > > _______________________________________________ > > > > python-chinese > > > > Post: send python-chinese at lists.python.cn > > > > Subscribe: send subscribe to > > > > python-chinese-request at lists.python.cn > > > > Unsubscribe: send unsubscribe to > > > > python-chinese-request at lists.python.cn > > > > Detail Info: > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese at lists.python.cn > > > Subscribe: send subscribe to > > python-chinese-request at lists.python.cn > > > Unsubscribe: send unsubscribe to > > python-chinese-request at lists.python.cn > > > Detail Info: > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese at lists.python.cn > > Subscribe: send subscribe to > > python-chinese-request at lists.python.cn > > Unsubscribe: send unsubscribe to > > python-chinese-request at lists.python.cn > > Detail Info: > > http://python.cn/mailman/listinfo/python-chinese > > > > > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060419/d94b0fac/attachment.htm

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年04月19日 星期三 23:20

tocer tocer.deng at gmail.com
Wed Apr 19 23:20:59 HKT 2006

问题的原因是:
执行到     ie.buttonClick("install")  
这一句的时候,程序停下来等待客户确认,不再往下执行,也就是说查找窗口的语句根本没有执行到。

解决的方法,用线程去执行  ie.buttonClick("install") 试试

在 06-4-19,xianglong yin<yinxianglong at gmail.com> 写道:
>
> 对啊,内部网页。这个内部的网页是需要安装证书这些,很麻烦的。
>
> 但是我在用pamie测试文件浏览对话框时也不能找到,
> 例如:
> 网页文件(1.html):
> 
> >
> python代码如下: > import cPAMIE, winGuiAuto > > ie = cPAMIE.PAMIE() > wga = winGuiAuto > # 登录 > ie.navigate("d:\\1.html") > ie.buttonClick("install") > #点击上面的按钮"install"之后,有一个"文件选择"的对话框弹出来,就需要控制对话框上的控件了 > # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。 > hwnd = wga.findTopWindow(wantedText="选择文件") > # 点击取消按钮 > cancelButton = wga.findControl(hwnd, wantedClass="Button", > wantedText="取消") > clickButton(cancelButton ) > > 这段python代码不能找到 "选择文件"的对话框。 > > > 在06-4-19,tocer <tocer.deng at gmail.com> 写道: > > 从程序上看不出什么错误,你那个网页是内部网页么?有没有相似的网站,我上去试试? > > > > 在 06-4-19,xianglong yin< yinxianglong at gmail.com> 写道: > > > > > > 我的代码是这样的 > > > import cPAMIE, winGuiAuto > > > > > > ie = cPAMIE.PAMIE() > > > wga = winGuiAuto > > > # 登录 > > > ie.navigate(" http://192.168.28.130:10003/exp") > > > ie.textBoxSet("{actionForm.userName }", "0102") > > > ie.textBoxSet("{actionForm.userPwd}", "01020000") > > > ie.textBoxSet ("{actionForm.instCode}", "01020000") > > > #点击下面按钮"I1"之后,有一个"证书选择"的对话框弹出来,就需要点击对话框上的确定 > > > ie.buttonClick("I1") > > > # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。 > > > hwnd = wga.findTopWindow(wantedText="证书选择")# > > > okButton = wga.findControl(hwnd, wantedClass="Button", > wantedText="确定") > > > clickButton(okButton) > > > > > > 请帮我找找问题,多谢各位! > > > > > > > > > > > > 在06-4-18,tocer <tocer.deng at gmail.com> 写道: > > > > 代码贴出来看看 > > > > > > > > 在 06-4-17,xianglong yin< yinxianglong at gmail.com > 写道: > > > > > > > > > > > > > > > 我在用pamie做网页表单测试的时候,遇到了需要处理弹出对话框,比如 > > > > > "证书选择"、"选择文件"、"保存文件"的对话框。 > > > > > 我根据网上的一些资料采用winGuiAuto的方法 > > > > > findTopWindow(wantedText="证书选择")来处理,老是失败。 > > > > > 而且我也采用转码的方式: > > > > > findTopWindow(wantedText=u"证书选择") > > > > > > > > > > findTopWindow(wantedText=r"证书选择") > > > > > > > > > > findTopWindow(wantedText=unicode("证书选择","cp936")) > > > > > 等等转码方式都试过了,依然不能 通过findTopWindow来找到弹出窗口。 > > > > > > > > > > 希望大家能给予我帮助,感激不尽!! > > > > > _______________________________________________ > > > > > python-chinese > > > > > Post: send python-chinese at lists.python.cn > > > > > Subscribe: send subscribe to > > > > > python-chinese-request at lists.python.cn > > > > > Unsubscribe: send unsubscribe to > > > > > python-chinese-request at lists.python.cn > > > > > Detail Info: > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > python-chinese > > > > Post: send python-chinese at lists.python.cn > > > > Subscribe: send subscribe to > > > python-chinese-request at lists.python.cn > > > > Unsubscribe: send unsubscribe to > > > python-chinese-request at lists.python.cn > > > > Detail Info: > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese at lists.python.cn > > > Subscribe: send subscribe to > > > python-chinese-request at lists.python.cn > > > Unsubscribe: send unsubscribe to > > > python-chinese-request at lists.python.cn > > > Detail Info: > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese at lists.python.cn > > Subscribe: send subscribe to > python-chinese-request at lists.python.cn > > Unsubscribe: send unsubscribe to > python-chinese-request at lists.python.cn > > Detail Info: > http://python.cn/mailman/listinfo/python-chinese > > > > > > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to > python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to > python-chinese-request at lists.python.cn > Detail Info: > http://python.cn/mailman/listinfo/python-chinese > >

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年04月20日 星期四 08:32

xianglong yin yinxianglong at gmail.com
Thu Apr 20 08:32:27 HKT 2006

可以给我一些范例代码吗?因为我用pamie2.0包里面的buildCert.py文件做测试,它里面就用线程实现的,但是依然不能识别中文的"确认"按钮。
谢谢tocer大哥


在06-4-19,tocer <tocer.deng at gmail.com> 写道:
>
> 问题的原因是:
> 执行到     ie.buttonClick("install")
> 这一句的时候,程序停下来等待客户确认,不再往下执行,也就是说查找窗口的语句根本没有执行到。
>
> 解决的方法,用线程去执行  ie.buttonClick("install") 试试
>
> 在 06-4-19,xianglong yin<yinxianglong at gmail.com> 写道:
> >
> > 对啊,内部网页。这个内部的网页是需要安装证书这些,很麻烦的。
> >
> > 但是我在用pamie测试文件浏览对话框时也不能找到,
> > 例如:
> > 网页文件(1.html):
> > 
> > > >
> > python代码如下: > > import cPAMIE, winGuiAuto > > > > ie = cPAMIE.PAMIE() > > wga = winGuiAuto > > # 登录 > > ie.navigate("d:\\1.html") > > ie.buttonClick("install") > > #点击上面的按钮"install"之后,有一个"文件选择"的对话框弹出来,就需要控制对话框上的控件了 > > # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。 > > hwnd = wga.findTopWindow(wantedText="选择文件") > > # 点击取消按钮 > > cancelButton = wga.findControl(hwnd, wantedClass="Button", > > wantedText="取消") > > clickButton(cancelButton ) > > > > 这段python代码不能找到 "选择文件"的对话框。 > > > > > > 在06-4-19,tocer <tocer.deng at gmail.com> 写道: > > > 从程序上看不出什么错误,你那个网页是内部网页么?有没有相似的网站,我上去试试? > > > > > > 在 06-4-19,xianglong yin< yinxianglong at gmail.com> 写道: > > > > > > > > 我的代码是这样的 > > > > import cPAMIE, winGuiAuto > > > > > > > > ie = cPAMIE.PAMIE() > > > > wga = winGuiAuto > > > > # 登录 > > > > ie.navigate(" http://192.168.28.130:10003/exp") > > > > ie.textBoxSet("{actionForm.userName }", "0102") > > > > ie.textBoxSet("{actionForm.userPwd}", "01020000") > > > > ie.textBoxSet ("{actionForm.instCode}", "01020000") > > > > #点击下面按钮"I1"之后,有一个"证书选择"的对话框弹出来,就需要点击对话框上的确定 > > > > ie.buttonClick("I1") > > > > # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。 > > > > hwnd = wga.findTopWindow(wantedText="证书选择")# > > > > okButton = wga.findControl(hwnd, wantedClass="Button", > > wantedText="确定") > > > > clickButton(okButton) > > > > > > > > 请帮我找找问题,多谢各位! > > > > > > > > > > > > > > > > 在06-4-18,tocer <tocer.deng at gmail.com> 写道: > > > > > 代码贴出来看看 > > > > > > > > > > 在 06-4-17,xianglong yin< yinxianglong at gmail.com > 写道: > > > > > > > > > > > > > > > > > > 我在用pamie做网页表单测试的时候,遇到了需要处理弹出对话框,比如 > > > > > > "证书选择"、"选择文件"、"保存文件"的对话框。 > > > > > > 我根据网上的一些资料采用winGuiAuto的方法 > > > > > > findTopWindow(wantedText="证书选择")来处理,老是失败。 > > > > > > 而且我也采用转码的方式: > > > > > > findTopWindow(wantedText=u"证书选择") > > > > > > > > > > > > findTopWindow(wantedText=r"证书选择") > > > > > > > > > > > > findTopWindow(wantedText=unicode("证书选择","cp936")) > > > > > > 等等转码方式都试过了,依然不能 通过findTopWindow来找到弹出窗口。 > > > > > > > > > > > > 希望大家能给予我帮助,感激不尽!! > > > > > > _______________________________________________ > > > > > > python-chinese > > > > > > Post: send python-chinese at lists.python.cn > > > > > > Subscribe: send subscribe to > > > > > > python-chinese-request at lists.python.cn > > > > > > Unsubscribe: send unsubscribe to > > > > > > python-chinese-request at lists.python.cn > > > > > > Detail Info: > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > python-chinese > > > > > Post: send python-chinese at lists.python.cn > > > > > Subscribe: send subscribe to > > > > python-chinese-request at lists.python.cn > > > > > Unsubscribe: send unsubscribe to > > > > python-chinese-request at lists.python.cn > > > > > Detail Info: > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > python-chinese > > > > Post: send python-chinese at lists.python.cn > > > > Subscribe: send subscribe to > > > > python-chinese-request at lists.python.cn > > > > Unsubscribe: send unsubscribe to > > > > python-chinese-request at lists.python.cn > > > > Detail Info: > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese at lists.python.cn > > > Subscribe: send subscribe to > > python-chinese-request at lists.python.cn > > > Unsubscribe: send unsubscribe to > > python-chinese-request at lists.python.cn > > > Detail Info: > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese at lists.python.cn > > Subscribe: send subscribe to > > python-chinese-request at lists.python.cn > > Unsubscribe: send unsubscribe to > > python-chinese-request at lists.python.cn > > Detail Info: > > http://python.cn/mailman/listinfo/python-chinese > > > > > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060420/3bcc43ed/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年04月20日 星期四 12:22

tocer tocer.deng at gmail.com
Thu Apr 20 12:22:23 HKT 2006

用附件中的文件覆盖原文件。下面是测试程序

网页文件(1.html):
from pamie20 import cPAMIE, cModalPopUp, winGuiAuto import time ie = cPAMIE.PAMIE() wga = winGuiAuto # 登录 ie.navigate("c:\\1.html") clickCancel = cModalPopUp.handlePopup("Confirm","取消") clickCancel.setPopupName("选择文件") //设置弹出窗体的标题 clickCancel.start() //启动新的进程 ie.buttonClick("install") time.sleep(1) clickCancel.join() //进程结束 原模块把popupname写死了,在非英语系统中,就会发生找不到窗口的问题。 你要感谢我的话,帮我给原作者写封信吧,请他改正这个问题。 在 06-4-20,xianglong yin<yinxianglong at gmail.com> 写道: > > 可以给我一些范例代码吗?因为我用pamie2.0包里面的buildCert.py文件做测试,它里面就用线程实现的,但是依然不能识别中文的"确认"按钮。 > 谢谢tocer大哥 > > > > 在06-4-19,tocer <tocer.deng at gmail.com> 写道: > > 问题的原因是: > > 执行到 ie.buttonClick("install") > > 这一句的时候,程序停下来等待客户确认,不再往下执行,也就是说查找窗口的语句根本没有执行到。 > > > > 解决的方法,用线程去执行 ie.buttonClick("install") 试试 > > > > 在 06-4-19,xianglong yin<yinxianglong at gmail.com> 写道: > > > > > > 对啊,内部网页。这个内部的网页是需要安装证书这些,很麻烦的。 > > > > > > 但是我在用pamie测试文件浏览对话框时也不能找到, > > > 例如: > > > 网页文件(1.html): > > >
> > > > > >
> > > python代码如下: > > > import cPAMIE, winGuiAuto > > > > > > ie = cPAMIE.PAMIE() > > > wga = winGuiAuto > > > # 登录 > > > ie.navigate("d:\\1.html") > > > ie.buttonClick("install") > > > #点击上面的按钮"install"之后,有一个"文件选择"的对话框弹出来,就需要控制对话框上的控件了 > > > # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。 > > > hwnd = wga.findTopWindow(wantedText="选择文件") > > > # 点击取消按钮 > > > cancelButton = wga.findControl(hwnd, wantedClass="Button", > > > wantedText="取消") > > > clickButton(cancelButton ) > > > > > > 这段python代码不能找到 "选择文件"的对话框。 > > > > > > > > > 在06-4-19,tocer <tocer.deng at gmail.com> 写道: > > > > 从程序上看不出什么错误,你那个网页是内部网页么?有没有相似的网站,我上去试试? > > > > > > > > 在 06-4-19,xianglong yin< yinxianglong at gmail.com> 写道: > > > > > > > > > > 我的代码是这样的 > > > > > import cPAMIE, winGuiAuto > > > > > > > > > > ie = cPAMIE.PAMIE () > > > > > wga = winGuiAuto > > > > > # 登录 > > > > > ie.navigate(" http://192.168.28.130:10003/exp") > > > > > ie.textBoxSet ("{actionForm.userName }", "0102") > > > > > ie.textBoxSet("{actionForm.userPwd}", "01020000") > > > > > ie.textBoxSet ("{actionForm.instCode}", "01020000") > > > > > #点击下面按钮"I1"之后,有一个"证书选择"的对话框弹出来,就需要点击对话框上的确定 > > > > > ie.buttonClick("I1") > > > > > # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。 > > > > > hwnd = wga.findTopWindow(wantedText="证书选择")# > > > > > okButton = wga.findControl(hwnd, wantedClass="Button", > > > wantedText="确定") > > > > > clickButton(okButton) > > > > > > > > > > 请帮我找找问题,多谢各位! > > > > > > > > > > > > > > > > > > > > 在06-4-18,tocer <tocer.deng at gmail.com> 写道: > > > > > > 代码贴出来看看 > > > > > > > > > > > > 在 06-4-17,xianglong yin< yinxianglong at gmail.com > 写道: > > > > > > > > > > > > > > > > > > > > > 我在用pamie做网页表单测试的时候,遇到了需要处理弹出对话框,比如 > > > > > > > "证书选择"、"选择文件"、"保存文件"的对话框。 > > > > > > > 我根据网上的一些资料采用winGuiAuto的方法 > > > > > > > findTopWindow(wantedText="证书选择")来处理,老是失败。 > > > > > > > 而且我也采用转码的方式: > > > > > > > findTopWindow(wantedText=u"证书选择") > > > > > > > > > > > > > > findTopWindow(wantedText=r"证书选择") > > > > > > > > > > > > > > > findTopWindow(wantedText=unicode("证书选择","cp936")) > > > > > > > 等等转码方式都试过了,依然不能 通过findTopWindow来找到弹出窗口。 > > > > > > > > > > > > > > 希望大家能给予我帮助,感激不尽!! > > > > > > > _______________________________________________ > > > > > > > python-chinese > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > Subscribe: send subscribe to > > > > > > > python-chinese-request at lists.python.cn > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > python-chinese-request at lists.python.cn > > > > > > > Detail Info: > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > python-chinese > > > > > > Post: send python-chinese at lists.python.cn > > > > > > Subscribe: send subscribe to > > > > > python-chinese-request at lists.python.cn > > > > > > Unsubscribe: send unsubscribe to > > > > > python-chinese-request at lists.python.cn > > > > > > Detail Info: > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > python-chinese > > > > > Post: send python-chinese at lists.python.cn > > > > > Subscribe: send subscribe to > > > > > python-chinese-request at lists.python.cn > > > > > Unsubscribe: send unsubscribe to > > > > > python-chinese-request at lists.python.cn > > > > > Detail Info: > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > python-chinese > > > > Post: send python-chinese at lists.python.cn > > > > Subscribe: send subscribe to > > > python-chinese-request at lists.python.cn > > > > Unsubscribe: send unsubscribe to > > > python-chinese-request at lists.python.cn > > > > Detail Info: > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese at lists.python.cn > > > Subscribe: send subscribe to > > > python-chinese-request at lists.python.cn > > > Unsubscribe: send unsubscribe to > > > python-chinese-request at lists.python.cn > > > Detail Info: > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese at lists.python.cn > > Subscribe: send subscribe to > python-chinese-request at lists.python.cn > > Unsubscribe: send unsubscribe to > python-chinese-request at lists.python.cn > > Detail Info: > http://python.cn/mailman/listinfo/python-chinese > > > > > > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to > python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to > python-chinese-request at lists.python.cn > Detail Info: > http://python.cn/mailman/listinfo/python-chinese > > -------------- next part -------------- """ cModalPopUp.py Revised: Jan 9th 2006 Developer: plhdpk Description: Class to handle pop up windows Licence: GNU General Public License (GPL) This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. """ import cPAMIE import winGuiAuto import win32gui import time import os, sys import warnings import threading import traceback import pprint warnings.filterwarnings("ignore") class handlePopup(threading.Thread): """ Construct a popup handler thread. parameters: type - The type of popup to expect. *args - One or more arguments to handle the popup, usually just a control name such as 'OK' or 'Cancel' works but sometimes a file name or string is needed as well. """ showDebugging = False # Show debug print lines? def __init__(self, type, *args): threading.Thread.__init__(self); self.wga = winGuiAuto; self.wn = win32gui; self.popupType = type; if type == 'ChooseFile': self.command = self.enterTextAndClickControl; self.popupName = 'Choose File'; self.args = args; elif type == 'Alert': self.command = self.clickControl; self.popupName = 'Microsoft Internet Explorer'; self.args = args; elif type == 'Confirm': self.command = self.clickControl; self.popupName = 'Microsoft Internet Explorer'; self.args = args; elif type == 'Prompt': self.command = self.enterTextAndClickControl; self.popupName = 'Explorer User Prompt'; self.args = args; else: self.command = self.clickControl; self.popupName = 'Microsoft Internet Explorer' self.args = 'Cancel;' def run(self): """ Override Threading's run() method. Finds the dialog and calls the required command with the arguments supplied in the constructor. TODO: Need to find an exit strategy if the dialog is not found. parameters: None returns: Nothing """ count = 10 while(count 0): time.sleep(1); try: hwnd = self.wn.FindWindow("#32770", self.popupName) try: apply(self.command, (hwnd, self.args,)) time.sleep(1) return except: if self.showDebugging: (ErrorType,ErrorValue,ErrorTB)=sys.exc_info() print sys.exc_info() traceback.print_exc(ErrorTB) except: pass count -= 1; return def enterTextAndClickControl(self, hwnd, args): """ Used for file choosers or prompt dialogs that enter text into a text box. parameters: hwnd: - The handle to the dialog. args[0] - The text to set in the text box in the dialog. args[1] - The button control name. returns: Nothing """ text=args[0]; control=args[1]; if self.showDebugging: print "Text and Control is: %s %s" %(text, control) x = self.wga.dumpWindow(hwnd) # dump out all the controls pprint.pprint(x) # print out all the controls inputBox = self.wga.findControl(hwnd, wantedClass="Edit") self.wga.setEditText(inputBox, text) time.sleep(.5) buttons = self.wga.findControls(hwnd, wantedClass="Button", wantedText=control) for b in buttons: self.wga.clickButton(b) def clickControl(self, hwnd, args): """ Used for simple dialogs that just have buttons such as 'ok', 'cancel' or 'clear'. parameters: hwnd: - The handle to the dialog. args[0] - The button control name. returns: Nothing """ controlText = args[0]; if self.showDebugging: x = self.wga.dumpWindow(hwnd) # dump out all the controls pprint.pprint(x) # print out all the controls button = self.wga.findControl(hwnd, wantedClass="Button", wantedText=controlText) self.wga.clickButton(button) # add by tocer 2006-04-19 def setPopupName(self, name): self.popupName = name

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年04月20日 星期四 13:35

xianglong yin yinxianglong at gmail.com
Thu Apr 20 13:35:50 HKT 2006

哈哈,tocer的确太棒了!

我刚刚测试已经不出现异常了,
如果我python自动点击对话框上面的"取消"按钮,
我加了行代码
clickCancel.clickControl(clickCancel,"取消")
但是运行起来没有反应啊(也就是 python程序没有去点击取消按钮),

我应该怎么做呢?
多谢tocer大哥啦





在06-4-20,tocer <tocer.deng at gmail.com> 写道:
>
> 用附件中的文件覆盖原文件。下面是测试程序
>
> 网页文件(1.html):
> 
> >
> > from pamie20 import cPAMIE, cModalPopUp, winGuiAuto > import time > > ie = cPAMIE.PAMIE() > wga = winGuiAuto > # 登录 > ie.navigate("c:\\1.html") > clickCancel = cModalPopUp.handlePopup("Confirm","取消") > clickCancel.setPopupName("选择文件") //设置弹出窗体的标题 > clickCancel.start() //启动新的进程 > ie.buttonClick("install") > time.sleep(1) > clickCancel.join() //进程结束 > > 原模块把popupname写死了,在非英语系统中,就会发生找不到窗口的问题。 > 你要感谢我的话,帮我给原作者写封信吧,请他改正这个问题。 > > 在 06-4-20,xianglong yin<yinxianglong at gmail.com> 写道: > > > > > 可以给我一些范例代码吗?因为我用pamie2.0包里面的buildCert.py文件做测试,它里面就用线程实现的,但是依然不能识别中文的"确认"按钮。 > > 谢谢tocer大哥 > > > > > > > > 在06-4-19,tocer <tocer.deng at gmail.com> 写道: > > > 问题的原因是: > > > 执行到 ie.buttonClick("install") > > > 这一句的时候,程序停下来等待客户确认,不再往下执行,也就是说查找窗口的语句根本没有执行到。 > > > > > > 解决的方法,用线程去执行 ie.buttonClick("install") 试试 > > > > > > 在 06-4-19,xianglong yin<yinxianglong at gmail.com> 写道: > > > > > > > > 对啊,内部网页。这个内部的网页是需要安装证书这些,很麻烦的。 > > > > > > > > 但是我在用pamie测试文件浏览对话框时也不能找到, > > > > 例如: > > > > 网页文件(1.html): > > > >
> name="installForm"> > > > > > > > >
> > > > python代码如下: > > > > import cPAMIE, winGuiAuto > > > > > > > > ie = cPAMIE.PAMIE() > > > > wga = winGuiAuto > > > > # 登录 > > > > ie.navigate("d:\\1.html") > > > > ie.buttonClick("install") > > > > #点击上面的按钮"install"之后,有一个"文件选择"的对话框弹出来,就需要控制对话框上的控件了 > > > > # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。 > > > > hwnd = wga.findTopWindow(wantedText="选择文件") > > > > # 点击取消按钮 > > > > cancelButton = wga.findControl(hwnd, wantedClass="Button", > > > > wantedText="取消") > > > > clickButton(cancelButton ) > > > > > > > > 这段python代码不能找到 "选择文件"的对话框。 > > > > > > > > > > > > 在06-4-19,tocer <tocer.deng at gmail.com> 写道: > > > > > 从程序上看不出什么错误,你那个网页是内部网页么?有没有相似的网站,我上去试试? > > > > > > > > > > 在 06-4-19,xianglong yin< yinxianglong at gmail.com> 写道: > > > > > > > > > > > > 我的代码是这样的 > > > > > > import cPAMIE, winGuiAuto > > > > > > > > > > > > ie = cPAMIE.PAMIE () > > > > > > wga = winGuiAuto > > > > > > # 登录 > > > > > > ie.navigate(" http://192.168.28.130:10003/exp") > > > > > > ie.textBoxSet ("{actionForm.userName }", "0102") > > > > > > ie.textBoxSet("{actionForm.userPwd}", "01020000") > > > > > > ie.textBoxSet ("{actionForm.instCode}", "01020000") > > > > > > #点击下面按钮"I1"之后,有一个"证书选择"的对话框弹出来,就需要点击对话框上的确定 > > > > > > ie.buttonClick("I1") > > > > > > # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。 > > > > > > hwnd = wga.findTopWindow(wantedText="证书选择")# > > > > > > okButton = wga.findControl(hwnd, wantedClass="Button", > > > > wantedText="确定") > > > > > > clickButton(okButton) > > > > > > > > > > > > 请帮我找找问题,多谢各位! > > > > > > > > > > > > > > > > > > > > > > > > 在06-4-18,tocer <tocer.deng at gmail.com> 写道: > > > > > > > 代码贴出来看看 > > > > > > > > > > > > > > 在 06-4-17,xianglong yin< yinxianglong at gmail.com > 写道: > > > > > > > > > > > > > > > > > > > > > > > > 我在用pamie做网页表单测试的时候,遇到了需要处理弹出对话框,比如 > > > > > > > > "证书选择"、"选择文件"、"保存文件"的对话框。 > > > > > > > > 我根据网上的一些资料采用winGuiAuto的方法 > > > > > > > > findTopWindow(wantedText="证书选择")来处理,老是失败。 > > > > > > > > 而且我也采用转码的方式: > > > > > > > > findTopWindow(wantedText=u"证书选择") > > > > > > > > > > > > > > > > findTopWindow(wantedText=r"证书选择") > > > > > > > > > > > > > > > > > > findTopWindow(wantedText=unicode("证书选择","cp936")) > > > > > > > > 等等转码方式都试过了,依然不能 通过findTopWindow来找到弹出窗口。 > > > > > > > > > > > > > > > > 希望大家能给予我帮助,感激不尽!! > > > > > > > > _______________________________________________ > > > > > > > > python-chinese > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > Subscribe: send subscribe to > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > Detail Info: > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > python-chinese > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > Subscribe: send subscribe to > > > > > > python-chinese-request at lists.python.cn > > > > > > > Unsubscribe: send unsubscribe to > > > > > > python-chinese-request at lists.python.cn > > > > > > > Detail Info: > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > python-chinese > > > > > > Post: send python-chinese at lists.python.cn > > > > > > Subscribe: send subscribe to > > > > > > python-chinese-request at lists.python.cn > > > > > > Unsubscribe: send unsubscribe to > > > > > > python-chinese-request at lists.python.cn > > > > > > Detail Info: > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > python-chinese > > > > > Post: send python-chinese at lists.python.cn > > > > > Subscribe: send subscribe to > > > > python-chinese-request at lists.python.cn > > > > > Unsubscribe: send unsubscribe to > > > > python-chinese-request at lists.python.cn > > > > > Detail Info: > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > python-chinese > > > > Post: send python-chinese at lists.python.cn > > > > Subscribe: send subscribe to > > > > python-chinese-request at lists.python.cn > > > > Unsubscribe: send unsubscribe to > > > > python-chinese-request at lists.python.cn > > > > Detail Info: > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese at lists.python.cn > > > Subscribe: send subscribe to > > python-chinese-request at lists.python.cn > > > Unsubscribe: send unsubscribe to > > python-chinese-request at lists.python.cn > > > Detail Info: > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese at lists.python.cn > > Subscribe: send subscribe to > > python-chinese-request at lists.python.cn > > Unsubscribe: send unsubscribe to > > python-chinese-request at lists.python.cn > > Detail Info: > > http://python.cn/mailman/listinfo/python-chinese > > > > > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060420/587b9042/attachment-0001.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年04月20日 星期四 13:53

tocer tocer.deng at gmail.com
Thu Apr 20 13:53:03 HKT 2006

目前已经完成了 python自动点击对话框上面的"取消"按钮。也许太快了,你没有发现有一个窗口一闪就过去了?

#这一句就是告诉系统自动点"取消"按钮
clickCancel = cModalPopUp.handlePopup("Confirm","取消")

不用再添加别的语句了

再仔细看看 cModalPopup 模块吧

在 06-4-20,xianglong yin<yinxianglong at gmail.com> 写道:
>
> 哈哈,tocer的确太棒了!
>
> 我刚刚测试已经不出现异常了,
> 如果我python自动点击对话框上面的"取消"按钮,
> 我加了行代码
> clickCancel.clickControl(clickCancel,"取消")
> 但是运行起来没有反应啊(也就是 python程序没有去点击取消按钮),
>
> 我应该怎么做呢?
> 多谢tocer大哥啦
>
>
>
>
>
> 在06-4-20,tocer <tocer.deng at gmail.com> 写道:
> > 用附件中的文件覆盖原文件。下面是测试程序
> >
> > 网页文件(1.html):
> > 
> > > >
> > > > from pamie20 import cPAMIE, cModalPopUp, winGuiAuto > > import time > > > > ie = cPAMIE.PAMIE() > > wga = winGuiAuto > > # 登录 > > ie.navigate ("c:\\1.html") > > clickCancel = cModalPopUp.handlePopup("Confirm","取消") > > clickCancel.setPopupName("选择文件") //设置弹出窗体的标题 > > clickCancel.start() //启动新的进程 > > ie.buttonClick("install") > > time.sleep(1) > > clickCancel.join() //进程结束 > > > > 原模块把popupname写死了,在非英语系统中,就会发生找不到窗口的问题。 > > 你要感谢我的话,帮我给原作者写封信吧,请他改正这个问题。 > > > > 在 06-4-20,xianglong yin<yinxianglong at gmail.com > 写道: > > > > > > > 可以给我一些范例代码吗?因为我用pamie2.0包里面的buildCert.py文件做测试,它里面就用线程实现的,但是依然不能识别中文的"确认"按钮。 > > > 谢谢tocer大哥 > > > > > > > > > > > > 在06-4-19,tocer < tocer.deng at gmail.com> 写道: > > > > 问题的原因是: > > > > 执行到 ie.buttonClick("install") > > > > 这一句的时候,程序停下来等待客户确认,不再往下执行,也就是说查找窗口的语句根本没有执行到。 > > > > > > > > 解决的方法,用线程去执行 ie.buttonClick ("install") 试试 > > > > > > > > 在 06-4-19,xianglong yin<yinxianglong at gmail.com> 写道: > > > > > > > > > > 对啊,内部网页。这个内部的网页是需要安装证书这些,很麻烦的。 > > > > > > > > > > 但是我在用pamie测试文件浏览对话框时也不能找到, > > > > > 例如: > > > > > 网页文件(1.html): > > > > >
> name="installForm"> > > > > > > > > > >
> > > > > python代码如下: > > > > > import cPAMIE, winGuiAuto > > > > > > > > > > ie = cPAMIE.PAMIE() > > > > > wga = winGuiAuto > > > > > # 登录 > > > > > ie.navigate("d:\\1.html") > > > > > ie.buttonClick("install") > > > > > > #点击上面的按钮"install"之后,有一个"文件选择"的对话框弹出来,就需要控制对话框上的控件了 > > > > > # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。 > > > > > hwnd = wga.findTopWindow(wantedText="选择文件") > > > > > # 点击取消按钮 > > > > > cancelButton = wga.findControl(hwnd, wantedClass="Button", > > > > > wantedText="取消") > > > > > clickButton(cancelButton ) > > > > > > > > > > 这段python代码不能找到 "选择文件"的对话框。 > > > > > > > > > > > > > > > 在06-4-19,tocer < tocer.deng at gmail.com> 写道: > > > > > > 从程序上看不出什么错误,你那个网页是内部网页么?有没有相似的网站,我上去试试? > > > > > > > > > > > > 在 06-4-19,xianglong yin< yinxianglong at gmail.com> 写道: > > > > > > > > > > > > > > 我的代码是这样的 > > > > > > > import cPAMIE, winGuiAuto > > > > > > > > > > > > > > ie = cPAMIE.PAMIE () > > > > > > > wga = winGuiAuto > > > > > > > # 登录 > > > > > > > ie.navigate(" http://192.168.28.130:10003/exp ") > > > > > > > ie.textBoxSet ("{actionForm.userName }", "0102") > > > > > > > ie.textBoxSet("{actionForm.userPwd}", "01020000") > > > > > > > ie.textBoxSet ("{actionForm.instCode}", "01020000") > > > > > > > #点击下面按钮"I1"之后,有一个"证书选择"的对话框弹出来,就需要点击对话框上的确定 > > > > > > > ie.buttonClick("I1") > > > > > > > # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。 > > > > > > > hwnd = wga.findTopWindow(wantedText="证书选择")# > > > > > > > okButton = wga.findControl(hwnd, wantedClass="Button", > > > > > wantedText="确定") > > > > > > > clickButton(okButton) > > > > > > > > > > > > > > 请帮我找找问题,多谢各位! > > > > > > > > > > > > > > > > > > > > > > > > > > > > 在06-4-18,tocer <tocer.deng at gmail.com> 写道: > > > > > > > > 代码贴出来看看 > > > > > > > > > > > > > > > > 在 06-4-17,xianglong yin< yinxianglong at gmail.com > 写道: > > > > > > > > > > > > > > > > > > > > > > > > > > > 我在用pamie做网页表单测试的时候,遇到了需要处理弹出对话框,比如 > > > > > > > > > "证书选择"、"选择文件"、"保存文件"的对话框。 > > > > > > > > > 我根据网上的一些资料采用winGuiAuto的方法 > > > > > > > > > findTopWindow(wantedText="证书选择")来处理,老是失败。 > > > > > > > > > 而且我也采用转码的方式: > > > > > > > > > findTopWindow(wantedText=u"证书选择") > > > > > > > > > > > > > > > > > > findTopWindow(wantedText=r"证书选择") > > > > > > > > > > > > > > > > > > > > > findTopWindow(wantedText=unicode("证书选择","cp936")) > > > > > > > > > 等等转码方式都试过了,依然不能 通过findTopWindow来找到弹出窗口。 > > > > > > > > > > > > > > > > > > 希望大家能给予我帮助,感激不尽!! > > > > > > > > > > _______________________________________________ > > > > > > > > > python-chinese > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > Detail Info: > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > python-chinese > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > Subscribe: send subscribe to > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > Detail Info: > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > python-chinese > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > Subscribe: send subscribe to > > > > > > > python-chinese-request at lists.python.cn > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > python-chinese-request at lists.python.cn > > > > > > > Detail Info: > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > python-chinese > > > > > > Post: send python-chinese at lists.python.cn > > > > > > Subscribe: send subscribe to > > > > > python-chinese-request at lists.python.cn > > > > > > Unsubscribe: send unsubscribe to > > > > > python-chinese-request at lists.python.cn > > > > > > Detail Info: > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > python-chinese > > > > > Post: send python-chinese at lists.python.cn > > > > > Subscribe: send subscribe to > > > > > python-chinese-request at lists.python.cn > > > > > Unsubscribe: send unsubscribe to > > > > > python-chinese-request at lists.python.cn > > > > > Detail Info: > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > python-chinese > > > > Post: send python-chinese at lists.python.cn > > > > Subscribe: send subscribe to > > > python-chinese-request at lists.python.cn > > > > Unsubscribe: send unsubscribe to > > > python-chinese-request at lists.python.cn > > > > Detail Info: > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese at lists.python.cn > > > Subscribe: send subscribe to > > > python-chinese-request at lists.python.cn > > > Unsubscribe: send unsubscribe to > > > python-chinese-request at lists.python.cn > > > Detail Info: > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese at lists.python.cn > > Subscribe: send subscribe to > python-chinese-request at lists.python.cn > > Unsubscribe: send unsubscribe to > python-chinese-request at lists.python.cn > > Detail Info: > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to > python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to > python-chinese-request at lists.python.cn > Detail Info: > http://python.cn/mailman/listinfo/python-chinese > >

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年04月20日 星期四 15:01

xianglong yin yinxianglong at gmail.com
Thu Apr 20 15:01:01 HKT 2006

啊哦,我没有发现呢!我这里只弹出了一个 文件选择的对话框,然后就不动了,什么都没有!


在06-4-20,tocer <tocer.deng at gmail.com> 写道:
>
> 目前已经完成了 python自动点击对话框上面的"取消"按钮。也许太快了,你没有发现有一个窗口一闪就过去了?
>
> #这一句就是告诉系统自动点"取消"按钮
> clickCancel = cModalPopUp.handlePopup("Confirm","取消")
>
> 不用再添加别的语句了
>
> 再仔细看看 cModalPopup 模块吧
>
> 在 06-4-20,xianglong yin<yinxianglong at gmail.com> 写道:
> >
> > 哈哈,tocer的确太棒了!
> >
> > 我刚刚测试已经不出现异常了,
> > 如果我python自动点击对话框上面的"取消"按钮,
> > 我加了行代码
> > clickCancel.clickControl(clickCancel,"取消")
> > 但是运行起来没有反应啊(也就是 python程序没有去点击取消按钮),
> >
> > 我应该怎么做呢?
> > 多谢tocer大哥啦
> >
> >
> >
> >
> >
> > 在06-4-20,tocer <tocer.deng at gmail.com> 写道:
> > > 用附件中的文件覆盖原文件。下面是测试程序
> > >
> > > 网页文件(1.html):
> > > 
> > > > > >
> > > > > > from pamie20 import cPAMIE, cModalPopUp, winGuiAuto > > > import time > > > > > > ie = cPAMIE.PAMIE() > > > wga = winGuiAuto > > > # 登录 > > > ie.navigate ("c:\\1.html") > > > clickCancel = cModalPopUp.handlePopup("Confirm","取消") > > > clickCancel.setPopupName("选择文件") //设置弹出窗体的标题 > > > clickCancel.start() //启动新的进程 > > > ie.buttonClick("install") > > > time.sleep(1) > > > clickCancel.join() //进程结束 > > > > > > 原模块把popupname写死了,在非英语系统中,就会发生找不到窗口的问题。 > > > 你要感谢我的话,帮我给原作者写封信吧,请他改正这个问题。 > > > > > > 在 06-4-20,xianglong yin<yinxianglong at gmail.com > 写道: > > > > > > > > > > > 可以给我一些范例代码吗?因为我用pamie2.0包里面的buildCert.py文件做测试,它里面就用线程实现的,但是依然不能识别中文的"确认"按钮。 > > > > 谢谢tocer大哥 > > > > > > > > > > > > > > > > 在06-4-19,tocer < tocer.deng at gmail.com> 写道: > > > > > 问题的原因是: > > > > > 执行到 ie.buttonClick("install") > > > > > 这一句的时候,程序停下来等待客户确认,不再往下执行,也就是说查找窗口的语句根本没有执行到。 > > > > > > > > > > 解决的方法,用线程去执行 ie.buttonClick ("install") 试试 > > > > > > > > > > 在 06-4-19,xianglong yin<yinxianglong at gmail.com> 写道: > > > > > > > > > > > > 对啊,内部网页。这个内部的网页是需要安装证书这些,很麻烦的。 > > > > > > > > > > > > 但是我在用pamie测试文件浏览对话框时也不能找到, > > > > > > 例如: > > > > > > 网页文件(1.html): > > > > > >
> > name="installForm"> > > > > > > > > > > > >
> > > > > > python代码如下: > > > > > > import cPAMIE, winGuiAuto > > > > > > > > > > > > ie = cPAMIE.PAMIE() > > > > > > wga = winGuiAuto > > > > > > # 登录 > > > > > > ie.navigate("d:\\1.html") > > > > > > ie.buttonClick("install") > > > > > > > > #点击上面的按钮"install"之后,有一个"文件选择"的对话框弹出来,就需要控制对话框上的控件了 > > > > > > # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。 > > > > > > hwnd = wga.findTopWindow(wantedText="选择文件") > > > > > > # 点击取消按钮 > > > > > > cancelButton = wga.findControl(hwnd, wantedClass="Button", > > > > > > wantedText="取消") > > > > > > clickButton(cancelButton ) > > > > > > > > > > > > 这段python代码不能找到 "选择文件"的对话框。 > > > > > > > > > > > > > > > > > > 在06-4-19,tocer < tocer.deng at gmail.com> 写道: > > > > > > > 从程序上看不出什么错误,你那个网页是内部网页么?有没有相似的网站,我上去试试? > > > > > > > > > > > > > > 在 06-4-19,xianglong yin< yinxianglong at gmail.com> 写道: > > > > > > > > > > > > > > > > 我的代码是这样的 > > > > > > > > import cPAMIE, winGuiAuto > > > > > > > > > > > > > > > > ie = cPAMIE.PAMIE () > > > > > > > > wga = winGuiAuto > > > > > > > > # 登录 > > > > > > > > ie.navigate(" http://192.168.28.130:10003/exp ") > > > > > > > > ie.textBoxSet ("{actionForm.userName }", "0102") > > > > > > > > ie.textBoxSet("{actionForm.userPwd}", "01020000") > > > > > > > > ie.textBoxSet ("{actionForm.instCode}", "01020000") > > > > > > > > #点击下面按钮"I1"之后,有一个"证书选择"的对话框弹出来,就需要点击对话框上的确定 > > > > > > > > ie.buttonClick("I1") > > > > > > > > # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。 > > > > > > > > hwnd = wga.findTopWindow(wantedText="证书选择")# > > > > > > > > okButton = wga.findControl(hwnd, wantedClass="Button", > > > > > > wantedText="确定") > > > > > > > > clickButton(okButton) > > > > > > > > > > > > > > > > 请帮我找找问题,多谢各位! > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 在06-4-18,tocer <tocer.deng at gmail.com> 写道: > > > > > > > > > 代码贴出来看看 > > > > > > > > > > > > > > > > > > 在 06-4-17,xianglong yin< yinxianglong at gmail.com > 写道: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 我在用pamie做网页表单测试的时候,遇到了需要处理弹出对话框,比如 > > > > > > > > > > "证书选择"、"选择文件"、"保存文件"的对话框。 > > > > > > > > > > 我根据网上的一些资料采用winGuiAuto的方法 > > > > > > > > > > findTopWindow(wantedText="证书选择")来处理,老是失败。 > > > > > > > > > > 而且我也采用转码的方式: > > > > > > > > > > findTopWindow(wantedText=u"证书选择") > > > > > > > > > > > > > > > > > > > > findTopWindow(wantedText=r"证书选择") > > > > > > > > > > > > > > > > > > > > > > > > findTopWindow(wantedText=unicode("证书选择","cp936")) > > > > > > > > > > 等等转码方式都试过了,依然不能 通过findTopWindow来找到弹出窗口。 > > > > > > > > > > > > > > > > > > > > 希望大家能给予我帮助,感激不尽!! > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > python-chinese > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > python-chinese > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > Subscribe: send subscribe to > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > Detail Info: > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > python-chinese > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > Subscribe: send subscribe to > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > Detail Info: > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > python-chinese > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > Subscribe: send subscribe to > > > > > > python-chinese-request at lists.python.cn > > > > > > > Unsubscribe: send unsubscribe to > > > > > > python-chinese-request at lists.python.cn > > > > > > > Detail Info: > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > python-chinese > > > > > > Post: send python-chinese at lists.python.cn > > > > > > Subscribe: send subscribe to > > > > > > python-chinese-request at lists.python.cn > > > > > > Unsubscribe: send unsubscribe to > > > > > > python-chinese-request at lists.python.cn > > > > > > Detail Info: > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > python-chinese > > > > > Post: send python-chinese at lists.python.cn > > > > > Subscribe: send subscribe to > > > > python-chinese-request at lists.python.cn > > > > > Unsubscribe: send unsubscribe to > > > > python-chinese-request at lists.python.cn > > > > > Detail Info: > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > python-chinese > > > > Post: send python-chinese at lists.python.cn > > > > Subscribe: send subscribe to > > > > python-chinese-request at lists.python.cn > > > > Unsubscribe: send unsubscribe to > > > > python-chinese-request at lists.python.cn > > > > Detail Info: > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese at lists.python.cn > > > Subscribe: send subscribe to > > python-chinese-request at lists.python.cn > > > Unsubscribe: send unsubscribe to > > python-chinese-request at lists.python.cn > > > Detail Info: > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese at lists.python.cn > > Subscribe: send subscribe to > > python-chinese-request at lists.python.cn > > Unsubscribe: send unsubscribe to > > python-chinese-request at lists.python.cn > > Detail Info: > > http://python.cn/mailman/listinfo/python-chinese > > > > > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060420/13f64497/attachment-0001.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年04月20日 星期四 15:11

tocer tocer.deng at gmail.com
Thu Apr 20 15:11:24 HKT 2006

这个就不知道了,我写的测试程序,在我这里很正常

在 06-4-20,xianglong yin<yinxianglong at gmail.com> 写道:
>
> 啊哦,我没有发现呢!我这里只弹出了一个 文件选择的对话框,然后就不动了,什么都没有!
>
>
>
> 在06-4-20,tocer <tocer.deng at gmail.com> 写道:
> > 目前已经完成了 python自动点击对话框上面的"取消"按钮。也许太快了,你没有发现有一个窗口一闪就过去了?
> >
> > #这一句就是告诉系统自动点"取消"按钮
> > clickCancel = cModalPopUp.handlePopup("Confirm","取消")
> >
> > 不用再添加别的语句了
> >
> > 再仔细看看 cModalPopup 模块吧
> >
> > 在 06-4-20,xianglong yin<yinxianglong at gmail.com> 写道:
> > >
> > > 哈哈,tocer的确太棒了!
> > >
> > > 我刚刚测试已经不出现异常了,
> > > 如果我python自动点击对话框上面的"取消"按钮,
> > > 我加了行代码
> > > clickCancel.clickControl(clickCancel,"取消")
> > > 但是运行起来没有反应啊(也就是 python程序没有去点击取消按钮),
> > >
> > > 我应该怎么做呢?
> > > 多谢tocer大哥啦
> > >
> > >
> > >
> > >
> > >
> > > 在06-4-20,tocer <tocer.deng at gmail.com> 写道:
> > > > 用附件中的文件覆盖原文件。下面是测试程序
> > > >
> > > > 网页文件(1.html):
> > > > 
> > > > > > > >
> > > > > > > > from pamie20 import cPAMIE, cModalPopUp, winGuiAuto > > > > import time > > > > > > > > ie = cPAMIE.PAMIE() > > > > wga = winGuiAuto > > > > # 登录 > > > > ie.navigate ("c:\\1.html") > > > > clickCancel = cModalPopUp.handlePopup("Confirm","取消") > > > > clickCancel.setPopupName("选择文件") //设置弹出窗体的标题 > > > > clickCancel.start () //启动新的进程 > > > > ie.buttonClick("install") > > > > time.sleep(1) > > > > clickCancel.join() //进程结束 > > > > > > > > 原模块把popupname写死了,在非英语系统中,就会发生找不到窗口的问题。 > > > > 你要感谢我的话,帮我给原作者写封信吧,请他改正这个问题。 > > > > > > > > 在 06-4-20,xianglong yin<yinxianglong at gmail.com > 写道: > > > > > > > > > > > > > > 可以给我一些范例代码吗?因为我用pamie2.0包里面的buildCert.py文件做测试,它里面就用线程实现的,但是依然不能识别中文的"确认"按钮。 > > > > > 谢谢tocer大哥 > > > > > > > > > > > > > > > > > > > > 在06-4-19,tocer < tocer.deng at gmail.com> 写道: > > > > > > 问题的原因是: > > > > > > 执行到 ie.buttonClick("install") > > > > > > 这一句的时候,程序停下来等待客户确认,不再往下执行,也就是说查找窗口的语句根本没有执行到。 > > > > > > > > > > > > 解决的方法,用线程去执行 ie.buttonClick ("install") 试试 > > > > > > > > > > > > 在 06-4-19,xianglong yin<yinxianglong at gmail.com> 写道: > > > > > > > > > > > > > > 对啊,内部网页。这个内部的网页是需要安装证书这些,很麻烦的。 > > > > > > > > > > > > > > 但是我在用pamie测试文件浏览对话框时也不能找到, > > > > > > > 例如: > > > > > > > 网页文件(1.html): > > > > > > >
> > > name="installForm"> > > > > > > > > > > > > > >
> > > > > > > python代码如下: > > > > > > > import cPAMIE, winGuiAuto > > > > > > > > > > > > > > ie = cPAMIE.PAMIE() > > > > > > > wga = winGuiAuto > > > > > > > # 登录 > > > > > > > ie.navigate("d:\\1.html") > > > > > > > ie.buttonClick("install") > > > > > > > > > > #点击上面的按钮"install"之后,有一个"文件选择"的对话框弹出来,就需要控制对话框上的控件了 > > > > > > > # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。 > > > > > > > hwnd = wga.findTopWindow(wantedText="选择文件") > > > > > > > # 点击取消按钮 > > > > > > > cancelButton = wga.findControl(hwnd, wantedClass="Button", > > > > > > > wantedText="取消") > > > > > > > clickButton(cancelButton ) > > > > > > > > > > > > > > 这段python代码不能找到 "选择文件"的对话框。 > > > > > > > > > > > > > > > > > > > > > 在06-4-19,tocer < tocer.deng at gmail.com> 写道: > > > > > > > > 从程序上看不出什么错误,你那个网页是内部网页么?有没有相似的网站,我上去试试? > > > > > > > > > > > > > > > > 在 06-4-19,xianglong yin< yinxianglong at gmail.com> 写道: > > > > > > > > > > > > > > > > > > 我的代码是这样的 > > > > > > > > > import cPAMIE, winGuiAuto > > > > > > > > > > > > > > > > > > ie = cPAMIE.PAMIE () > > > > > > > > > wga = winGuiAuto > > > > > > > > > # 登录 > > > > > > > > > ie.navigate(" http://192.168.28.130:10003/exp ") > > > > > > > > > ie.textBoxSet ("{actionForm.userName }", "0102") > > > > > > > > > ie.textBoxSet("{actionForm.userPwd}", "01020000") > > > > > > > > > ie.textBoxSet ("{actionForm.instCode}", "01020000") > > > > > > > > > > #点击下面按钮"I1"之后,有一个"证书选择"的对话框弹出来,就需要点击对话框上的确定 > > > > > > > > > ie.buttonClick ("I1") > > > > > > > > > # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。 > > > > > > > > > hwnd = wga.findTopWindow(wantedText="证书选择")# > > > > > > > > > okButton = wga.findControl(hwnd, wantedClass="Button", > > > > > > > wantedText="确定") > > > > > > > > > clickButton(okButton) > > > > > > > > > > > > > > > > > > 请帮我找找问题,多谢各位! > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 在06-4-18,tocer <tocer.deng at gmail.com > 写道: > > > > > > > > > > 代码贴出来看看 > > > > > > > > > > > > > > > > > > > > 在 06-4-17,xianglong yin< yinxianglong at gmail.com > 写道: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 我在用pamie做网页表单测试的时候,遇到了需要处理弹出对话框,比如 > > > > > > > > > > > "证书选择"、"选择文件"、"保存文件"的对话框。 > > > > > > > > > > > 我根据网上的一些资料采用winGuiAuto的方法 > > > > > > > > > > > > findTopWindow(wantedText="证书选择")来处理,老是失败。 > > > > > > > > > > > 而且我也采用转码的方式: > > > > > > > > > > > findTopWindow(wantedText=u"证书选择") > > > > > > > > > > > > > > > > > > > > > > findTopWindow(wantedText=r"证书选择") > > > > > > > > > > > > > > > > > > > > > > > > > > > findTopWindow(wantedText=unicode("证书选择","cp936")) > > > > > > > > > > > 等等转码方式都试过了,依然不能 通过findTopWindow来找到弹出窗口。 > > > > > > > > > > > > > > > > > > > > > > 希望大家能给予我帮助,感激不尽!! > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > python-chinese > > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > python-chinese > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > Detail Info: > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > python-chinese > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > Detail Info: > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > python-chinese > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > Subscribe: send subscribe to > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > Detail Info: > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > python-chinese > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > Subscribe: send subscribe to > > > > > > > python-chinese-request at lists.python.cn > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > python-chinese-request at lists.python.cn > > > > > > > Detail Info: > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > python-chinese > > > > > > Post: send python-chinese at lists.python.cn > > > > > > Subscribe: send subscribe to > > > > > python-chinese-request at lists.python.cn > > > > > > Unsubscribe: send unsubscribe to > > > > > python-chinese-request at lists.python.cn > > > > > > Detail Info: > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > python-chinese > > > > > Post: send python-chinese at lists.python.cn > > > > > Subscribe: send subscribe to > > > > > python-chinese-request at lists.python.cn > > > > > Unsubscribe: send unsubscribe to > > > > > python-chinese-request at lists.python.cn > > > > > Detail Info: > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > python-chinese > > > > Post: send python-chinese at lists.python.cn > > > > Subscribe: send subscribe to > > > python-chinese-request at lists.python.cn > > > > Unsubscribe: send unsubscribe to > > > python-chinese-request at lists.python.cn > > > > Detail Info: > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese at lists.python.cn > > > Subscribe: send subscribe to > > > python-chinese-request at lists.python.cn > > > Unsubscribe: send unsubscribe to > > > python-chinese-request at lists.python.cn > > > Detail Info: > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese at lists.python.cn > > Subscribe: send subscribe to > python-chinese-request at lists.python.cn > > Unsubscribe: send unsubscribe to > python-chinese-request at lists.python.cn > > Detail Info: > http://python.cn/mailman/listinfo/python-chinese > > > > > > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to > python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to > python-chinese-request at lists.python.cn > Detail Info: > http://python.cn/mailman/listinfo/python-chinese > >

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年04月20日 星期四 15:28

xianglong yin yinxianglong at gmail.com
Thu Apr 20 15:28:08 HKT 2006

tocer你是在ie上运行还是在其他浏览器上面运行?我用的mathon

在06-4-20,tocer <tocer.deng at gmail.com> 写道:
>
> 这个就不知道了,我写的测试程序,在我这里很正常
>
> 在 06-4-20,xianglong yin<yinxianglong at gmail.com> 写道:
> >
> > 啊哦,我没有发现呢!我这里只弹出了一个 文件选择的对话框,然后就不动了,什么都没有!
> >
> >
> >
> > 在06-4-20,tocer <tocer.deng at gmail.com> 写道:
> > > 目前已经完成了 python自动点击对话框上面的"取消"按钮。也许太快了,你没有发现有一个窗口一闪就过去了?
> > >
> > > #这一句就是告诉系统自动点"取消"按钮
> > > clickCancel = cModalPopUp.handlePopup("Confirm","取消")
> > >
> > > 不用再添加别的语句了
> > >
> > > 再仔细看看 cModalPopup 模块吧
> > >
> > > 在 06-4-20,xianglong yin<yinxianglong at gmail.com> 写道:
> > > >
> > > > 哈哈,tocer的确太棒了!
> > > >
> > > > 我刚刚测试已经不出现异常了,
> > > > 如果我python自动点击对话框上面的"取消"按钮,
> > > > 我加了行代码
> > > > clickCancel.clickControl(clickCancel,"取消")
> > > > 但是运行起来没有反应啊(也就是 python程序没有去点击取消按钮),
> > > >
> > > > 我应该怎么做呢?
> > > > 多谢tocer大哥啦
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > 在06-4-20,tocer <tocer.deng at gmail.com> 写道:
> > > > > 用附件中的文件覆盖原文件。下面是测试程序
> > > > >
> > > > > 网页文件(1.html):
> > > > > 
> name="installForm"> > > > > > > > > > >
> > > > > > > > > > from pamie20 import cPAMIE, cModalPopUp, winGuiAuto > > > > > import time > > > > > > > > > > ie = cPAMIE.PAMIE() > > > > > wga = winGuiAuto > > > > > # 登录 > > > > > ie.navigate ("c:\\1.html") > > > > > clickCancel = cModalPopUp.handlePopup("Confirm","取消") > > > > > clickCancel.setPopupName("选择文件") //设置弹出窗体的标题 > > > > > clickCancel.start () //启动新的进程 > > > > > ie.buttonClick("install") > > > > > time.sleep(1) > > > > > clickCancel.join() //进程结束 > > > > > > > > > > 原模块把popupname写死了,在非英语系统中,就会发生找不到窗口的问题。 > > > > > 你要感谢我的话,帮我给原作者写封信吧,请他改正这个问题。 > > > > > > > > > > 在 06-4-20,xianglong yin<yinxianglong at gmail.com > 写道: > > > > > > > > > > > > > > > > > > > 可以给我一些范例代码吗?因为我用pamie2.0包里面的buildCert.py文件做测试,它里面就用线程实现的,但是依然不能识别中文的"确认"按钮。 > > > > > > 谢谢tocer大哥 > > > > > > > > > > > > > > > > > > > > > > > > 在06-4-19,tocer < tocer.deng at gmail.com> 写道: > > > > > > > 问题的原因是: > > > > > > > 执行到 ie.buttonClick("install") > > > > > > > 这一句的时候,程序停下来等待客户确认,不再往下执行,也就是说查找窗口的语句根本没有执行到。 > > > > > > > > > > > > > > 解决的方法,用线程去执行 ie.buttonClick ("install") 试试 > > > > > > > > > > > > > > 在 06-4-19,xianglong yin<yinxianglong at gmail.com> 写道: > > > > > > > > > > > > > > > > 对啊,内部网页。这个内部的网页是需要安装证书这些,很麻烦的。 > > > > > > > > > > > > > > > > 但是我在用pamie测试文件浏览对话框时也不能找到, > > > > > > > > 例如: > > > > > > > > 网页文件(1.html): > > > > > > > >
> > > > name="installForm"> > > > > > > > > > > > > > > > >
> > > > > > > > python代码如下: > > > > > > > > import cPAMIE, winGuiAuto > > > > > > > > > > > > > > > > ie = cPAMIE.PAMIE() > > > > > > > > wga = winGuiAuto > > > > > > > > # 登录 > > > > > > > > ie.navigate("d:\\1.html") > > > > > > > > ie.buttonClick("install") > > > > > > > > > > > > #点击上面的按钮"install"之后,有一个"文件选择"的对话框弹出来,就需要控制对话框上的控件了 > > > > > > > > # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。 > > > > > > > > hwnd = wga.findTopWindow(wantedText="选择文件") > > > > > > > > # 点击取消按钮 > > > > > > > > cancelButton = wga.findControl(hwnd, > wantedClass="Button", > > > > > > > > wantedText="取消") > > > > > > > > clickButton(cancelButton ) > > > > > > > > > > > > > > > > 这段python代码不能找到 "选择文件"的对话框。 > > > > > > > > > > > > > > > > > > > > > > > > 在06-4-19,tocer < tocer.deng at gmail.com> 写道: > > > > > > > > > 从程序上看不出什么错误,你那个网页是内部网页么?有没有相似的网站,我上去试试? > > > > > > > > > > > > > > > > > > 在 06-4-19,xianglong yin< yinxianglong at gmail.com> 写道: > > > > > > > > > > > > > > > > > > > > 我的代码是这样的 > > > > > > > > > > import cPAMIE, winGuiAuto > > > > > > > > > > > > > > > > > > > > ie = cPAMIE.PAMIE () > > > > > > > > > > wga = winGuiAuto > > > > > > > > > > # 登录 > > > > > > > > > > ie.navigate(" http://192.168.28.130:10003/exp ") > > > > > > > > > > ie.textBoxSet ("{actionForm.userName }", "0102") > > > > > > > > > > ie.textBoxSet("{actionForm.userPwd}", "01020000") > > > > > > > > > > ie.textBoxSet ("{actionForm.instCode}", "01020000") > > > > > > > > > > > > #点击下面按钮"I1"之后,有一个"证书选择"的对话框弹出来,就需要点击对话框上的确定 > > > > > > > > > > ie.buttonClick ("I1") > > > > > > > > > > # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。 > > > > > > > > > > hwnd = wga.findTopWindow(wantedText="证书选择")# > > > > > > > > > > okButton = wga.findControl(hwnd, > wantedClass="Button", > > > > > > > > wantedText="确定") > > > > > > > > > > clickButton(okButton) > > > > > > > > > > > > > > > > > > > > 请帮我找找问题,多谢各位! > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 在06-4-18,tocer <tocer.deng at gmail.com > 写道: > > > > > > > > > > > 代码贴出来看看 > > > > > > > > > > > > > > > > > > > > > > 在 06-4-17,xianglong yin< yinxianglong at gmail.com > 写道: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 我在用pamie做网页表单测试的时候,遇到了需要处理弹出对话框,比如 > > > > > > > > > > > > "证书选择"、"选择文件"、"保存文件"的对话框。 > > > > > > > > > > > > 我根据网上的一些资料采用winGuiAuto的方法 > > > > > > > > > > > > > > findTopWindow(wantedText="证书选择")来处理,老是失败。 > > > > > > > > > > > > 而且我也采用转码的方式: > > > > > > > > > > > > findTopWindow(wantedText=u"证书选择") > > > > > > > > > > > > > > > > > > > > > > > > findTopWindow(wantedText=r"证书选择") > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > findTopWindow(wantedText=unicode("证书选择","cp936")) > > > > > > > > > > > > 等等转码方式都试过了,依然不能 通过findTopWindow来找到弹出窗口。 > > > > > > > > > > > > > > > > > > > > > > > > 希望大家能给予我帮助,感激不尽!! > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > > python-chinese > > > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > python-chinese > > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > python-chinese > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > python-chinese > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > Subscribe: send subscribe to > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > Detail Info: > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > python-chinese > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > Subscribe: send subscribe to > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > Detail Info: > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > python-chinese > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > Subscribe: send subscribe to > > > > > > python-chinese-request at lists.python.cn > > > > > > > Unsubscribe: send unsubscribe to > > > > > > python-chinese-request at lists.python.cn > > > > > > > Detail Info: > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > python-chinese > > > > > > Post: send python-chinese at lists.python.cn > > > > > > Subscribe: send subscribe to > > > > > > python-chinese-request at lists.python.cn > > > > > > Unsubscribe: send unsubscribe to > > > > > > python-chinese-request at lists.python.cn > > > > > > Detail Info: > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > python-chinese > > > > > Post: send python-chinese at lists.python.cn > > > > > Subscribe: send subscribe to > > > > python-chinese-request at lists.python.cn > > > > > Unsubscribe: send unsubscribe to > > > > python-chinese-request at lists.python.cn > > > > > Detail Info: > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > python-chinese > > > > Post: send python-chinese at lists.python.cn > > > > Subscribe: send subscribe to > > > > python-chinese-request at lists.python.cn > > > > Unsubscribe: send unsubscribe to > > > > python-chinese-request at lists.python.cn > > > > Detail Info: > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese at lists.python.cn > > > Subscribe: send subscribe to > > python-chinese-request at lists.python.cn > > > Unsubscribe: send unsubscribe to > > python-chinese-request at lists.python.cn > > > Detail Info: > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese at lists.python.cn > > Subscribe: send subscribe to > > python-chinese-request at lists.python.cn > > Unsubscribe: send unsubscribe to > > python-chinese-request at lists.python.cn > > Detail Info: > > http://python.cn/mailman/listinfo/python-chinese > > > > > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060420/8450cb43/attachment-0001.htm

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年04月20日 星期四 15:28

xianglong yin yinxianglong at gmail.com
Thu Apr 20 15:28:21 HKT 2006

maxthon

在06-4-20,xianglong yin <yinxianglong at gmail.com> 写道:
>
> tocer你是在ie上运行还是在其他浏览器上面运行?我用的mathon
>
>
> 在06-4-20,tocer <tocer.deng at gmail.com> 写道:
> >
> > 这个就不知道了,我写的测试程序,在我这里很正常
> >
> > 在 06-4-20,xianglong yin<yinxianglong at gmail.com > 写道:
> > >
> > > 啊哦,我没有发现呢!我这里只弹出了一个 文件选择的对话框,然后就不动了,什么都没有!
> > >
> > >
> > >
> > > 在06-4-20,tocer <tocer.deng at gmail.com> 写道:
> > > > 目前已经完成了 python自动点击对话框上面的"取消"按钮。也许太快了,你没有发现有一个窗口一闪就过去了?
> > > >
> > > > #这一句就是告诉系统自动点"取消"按钮
> > > > clickCancel = cModalPopUp.handlePopup("Confirm","取消")
> > > >
> > > > 不用再添加别的语句了
> > > >
> > > > 再仔细看看 cModalPopup 模块吧
> > > >
> > > > 在 06-4-20,xianglong yin<yinxianglong at gmail.com> 写道:
> > > > >
> > > > > 哈哈,tocer的确太棒了!
> > > > >
> > > > > 我刚刚测试已经不出现异常了,
> > > > > 如果我python自动点击对话框上面的"取消"按钮,
> > > > > 我加了行代码
> > > > > clickCancel.clickControl(clickCancel,"取消")
> > > > > 但是运行起来没有反应啊(也就是 python程序没有去点击取消按钮),
> > > > >
> > > > > 我应该怎么做呢?
> > > > > 多谢tocer大哥啦
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > 在06-4-20,tocer < tocer.deng at gmail.com> 写道:
> > > > > > 用附件中的文件覆盖原文件。下面是测试程序
> > > > > >
> > > > > > 网页文件(1.html):
> > > > > > 
> > name="installForm"> > > > > > > > > > > > >
> > > > > > > > > > > > from pamie20 import cPAMIE, cModalPopUp, winGuiAuto > > > > > > import time > > > > > > > > > > > > ie = cPAMIE.PAMIE() > > > > > > wga = winGuiAuto > > > > > > # 登录 > > > > > > ie.navigate ("c:\\1.html") > > > > > > clickCancel = cModalPopUp.handlePopup("Confirm","取消") > > > > > > clickCancel.setPopupName("选择文件") //设置弹出窗体的标题 > > > > > > clickCancel.start () //启动新的进程 > > > > > > ie.buttonClick("install") > > > > > > time.sleep(1) > > > > > > clickCancel.join() //进程结束 > > > > > > > > > > > > 原模块把popupname写死了,在非英语系统中,就会发生找不到窗口的问题。 > > > > > > 你要感谢我的话,帮我给原作者写封信吧,请他改正这个问题。 > > > > > > > > > > > > 在 06-4-20,xianglong yin<yinxianglong at gmail.com > 写道: > > > > > > > > > > > > > > > > > > > > > > > > 可以给我一些范例代码吗?因为我用pamie2.0包里面的buildCert.py文件做测试,它里面就用线程实现的,但是依然不能识别中文的"确认"按钮。 > > > > > > > 谢谢tocer大哥 > > > > > > > > > > > > > > > > > > > > > > > > > > > > 在06-4-19,tocer < tocer.deng at gmail.com> 写道: > > > > > > > > 问题的原因是: > > > > > > > > 执行到 ie.buttonClick("install") > > > > > > > > 这一句的时候,程序停下来等待客户确认,不再往下执行,也就是说查找窗口的语句根本没有执行到。 > > > > > > > > > > > > > > > > 解决的方法,用线程去执行 ie.buttonClick ("install") 试试 > > > > > > > > > > > > > > > > 在 06-4-19,xianglong yin<yinxianglong at gmail.com> 写道: > > > > > > > > > > > > > > > > > > 对啊,内部网页。这个内部的网页是需要安装证书这些,很麻烦的。 > > > > > > > > > > > > > > > > > > 但是我在用pamie测试文件浏览对话框时也不能找到, > > > > > > > > > 例如: > > > > > > > > > 网页文件(1.html): > > > > > > > > >
> > > > > name="installForm"> > > > > > > > > > > > > > > > > > >
> > > > > > > > > python代码如下: > > > > > > > > > import cPAMIE, winGuiAuto > > > > > > > > > > > > > > > > > > ie = cPAMIE.PAMIE() > > > > > > > > > wga = winGuiAuto > > > > > > > > > # 登录 > > > > > > > > > ie.navigate("d:\\1.html") > > > > > > > > > ie.buttonClick("install") > > > > > > > > > > > > > > #点击上面的按钮"install"之后,有一个"文件选择"的对话框弹出来,就需要控制对话框上的控件了 > > > > > > > > > # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。 > > > > > > > > > hwnd = wga.findTopWindow (wantedText="选择文件") > > > > > > > > > # 点击取消按钮 > > > > > > > > > cancelButton = wga.findControl(hwnd, > > wantedClass="Button", > > > > > > > > > wantedText="取消") > > > > > > > > > clickButton(cancelButton ) > > > > > > > > > > > > > > > > > > 这段python代码不能找到 "选择文件"的对话框。 > > > > > > > > > > > > > > > > > > > > > > > > > > > 在06-4-19,tocer < tocer.deng at gmail.com> 写道: > > > > > > > > > > 从程序上看不出什么错误,你那个网页是内部网页么?有没有相似的网站,我上去试试? > > > > > > > > > > > > > > > > > > > > 在 06-4-19,xianglong yin< yinxianglong at gmail.com> 写道: > > > > > > > > > > > > > > > > > > > > > > 我的代码是这样的 > > > > > > > > > > > import cPAMIE, winGuiAuto > > > > > > > > > > > > > > > > > > > > > > ie = cPAMIE.PAMIE () > > > > > > > > > > > wga = winGuiAuto > > > > > > > > > > > # 登录 > > > > > > > > > > > ie.navigate(" http://192.168.28.130:10003/exp ") > > > > > > > > > > > ie.textBoxSet ("{actionForm.userName }", "0102") > > > > > > > > > > > ie.textBoxSet ("{actionForm.userPwd}", "01020000") > > > > > > > > > > > ie.textBoxSet ("{actionForm.instCode}", > > "01020000") > > > > > > > > > > > > > > #点击下面按钮"I1"之后,有一个"证书选择"的对话框弹出来,就需要点击对话框上的确定 > > > > > > > > > > > ie.buttonClick ("I1") > > > > > > > > > > > # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。 > > > > > > > > > > > hwnd = wga.findTopWindow(wantedText="证书选择")# > > > > > > > > > > > okButton = wga.findControl(hwnd, > > wantedClass="Button", > > > > > > > > > wantedText="确定") > > > > > > > > > > > clickButton(okButton) > > > > > > > > > > > > > > > > > > > > > > 请帮我找找问题,多谢各位! > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 在06-4-18,tocer < tocer.deng at gmail.com > 写道: > > > > > > > > > > > > 代码贴出来看看 > > > > > > > > > > > > > > > > > > > > > > > > 在 06-4-17,xianglong yin< yinxianglong at gmail.com > > > 写道: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 我在用pamie做网页表单测试的时候,遇到了需要处理弹出对话框,比如 > > > > > > > > > > > > > "证书选择"、"选择文件"、"保存文件"的对话框。 > > > > > > > > > > > > > 我根据网上的一些资料采用winGuiAuto的方法 > > > > > > > > > > > > > > > > findTopWindow(wantedText="证书选择")来处理,老是失败。 > > > > > > > > > > > > > 而且我也采用转码的方式: > > > > > > > > > > > > > findTopWindow(wantedText=u"证书选择") > > > > > > > > > > > > > > > > > > > > > > > > > > findTopWindow(wantedText=r"证书选择") > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > findTopWindow(wantedText=unicode("证书选择","cp936")) > > > > > > > > > > > > > 等等转码方式都试过了,依然不能 通过findTopWindow来找到弹出窗口。 > > > > > > > > > > > > > > > > > > > > > > > > > > 希望大家能给予我帮助,感激不尽!! > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > > > python-chinese > > > > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > > python-chinese > > > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > python-chinese > > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > python-chinese > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > Detail Info: > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > python-chinese > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > Detail Info: > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > python-chinese > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > Subscribe: send subscribe to > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > Detail Info: > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > python-chinese > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > Subscribe: send subscribe to > > > > > > > python-chinese-request at lists.python.cn > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > python-chinese-request at lists.python.cn > > > > > > > Detail Info: > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > python-chinese > > > > > > Post: send python-chinese at lists.python.cn > > > > > > Subscribe: send subscribe to > > > > > python-chinese-request at lists.python.cn > > > > > > Unsubscribe: send unsubscribe to > > > > > python-chinese-request at lists.python.cn > > > > > > Detail Info: > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > python-chinese > > > > > Post: send python-chinese at lists.python.cn > > > > > Subscribe: send subscribe to > > > > > python-chinese-request at lists.python.cn > > > > > Unsubscribe: send unsubscribe to > > > > > python-chinese-request at lists.python.cn > > > > > Detail Info: > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > python-chinese > > > > Post: send python-chinese at lists.python.cn > > > > Subscribe: send subscribe to > > > python-chinese-request at lists.python.cn > > > > Unsubscribe: send unsubscribe to > > > python-chinese-request at lists.python.cn > > > > Detail Info: > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese at lists.python.cn > > > Subscribe: send subscribe to > > > python-chinese-request at lists.python.cn > > > Unsubscribe: send unsubscribe to > > > python-chinese-request at lists.python.cn > > > Detail Info: > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese at lists.python.cn > > Subscribe: send subscribe to python-chinese-request at lists.python.cn > > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060420/6ac3e36f/attachment-0001.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年04月20日 星期四 15:37

tocer tocer.deng at gmail.com
Thu Apr 20 15:37:22 HKT 2006

用qq说吧:578205792,否则太累
关键字:python

在 06-4-20,xianglong yin<yinxianglong at gmail.com> 写道:
> maxthon
>
>
> 在06-4-20,xianglong yin <yinxianglong at gmail.com> 写道:
> >
> > tocer你是在ie上运行还是在其他浏览器上面运行?我用的mathon
> >
> >
> >
> > 在06-4-20,tocer <tocer.deng at gmail.com> 写道:
> > > 这个就不知道了,我写的测试程序,在我这里很正常
> > >
> > > 在 06-4-20,xianglong yin< yinxianglong at gmail.com > 写道:
> > > >
> > > > 啊哦,我没有发现呢!我这里只弹出了一个 文件选择的对话框,然后就不动了,什么都没有!
> > > >
> > > >
> > > >
> > > > 在06-4-20,tocer < tocer.deng at gmail.com> 写道:
> > > > > 目前已经完成了
> python自动点击对话框上面的"取消"按钮。也许太快了,你没有发现有一个窗口一闪就过去了?
> > > > >
> > > > > #这一句就是告诉系统自动点"取消"按钮
> > > > > clickCancel = cModalPopUp.handlePopup("Confirm","取消")
> > > > >
> > > > > 不用再添加别的语句了
> > > > >
> > > > > 再仔细看看 cModalPopup 模块吧
> > > > >
> > > > > 在 06-4-20,xianglong yin< yinxianglong at gmail.com> 写道:
> > > > > >
> > > > > > 哈哈,tocer的确太棒了!
> > > > > >
> > > > > > 我刚刚测试已经不出现异常了,
> > > > > > 如果我python自动点击对话框上面的"取消"按钮,
> > > > > > 我加了行代码
> > > > > > clickCancel.clickControl(clickCancel,"取消")
> > > > > > 但是运行起来没有反应啊(也就是 python程序没有去点击取消按钮),
> > > > > >
> > > > > > 我应该怎么做呢?
> > > > > > 多谢tocer大哥啦
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > 在06-4-20,tocer < tocer.deng at gmail.com > 写道:
> > > > > > > 用附件中的文件覆盖原文件。下面是测试程序
> > > > > > >
> > > > > > > 网页文件(1.html):
> > > > > > > 
> name="installForm"> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > from pamie20 import cPAMIE, cModalPopUp, winGuiAuto > > > > > > > import time > > > > > > > > > > > > > > ie = cPAMIE.PAMIE() > > > > > > > wga = winGuiAuto > > > > > > > # 登录 > > > > > > > ie.navigate ("c:\\1.html") > > > > > > > clickCancel = cModalPopUp.handlePopup("Confirm","取消") > > > > > > > clickCancel.setPopupName("选择文件") //设置弹出窗体的标题 > > > > > > > clickCancel.start () //启动新的进程 > > > > > > > ie.buttonClick("install") > > > > > > > time.sleep(1) > > > > > > > clickCancel.join() //进程结束 > > > > > > > > > > > > > > 原模块把popupname写死了,在非英语系统中,就会发生找不到窗口的问题。 > > > > > > > 你要感谢我的话,帮我给原作者写封信吧,请他改正这个问题。 > > > > > > > > > > > > > > 在 06-4-20,xianglong yin< yinxianglong at gmail.com > 写道: > > > > > > > > > > > > > > > > > > > > > > > > > > > 可以给我一些范例代码吗?因为我用pamie2.0包里面的buildCert.py文件做测试,它里面就用线程实现的,但是依然不能识别中文的"确认"按钮。 > > > > > > > > 谢谢tocer大哥 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 在06-4-19,tocer < tocer.deng at gmail.com> 写道: > > > > > > > > > 问题的原因是: > > > > > > > > > 执行到 ie.buttonClick("install") > > > > > > > > > > 这一句的时候,程序停下来等待客户确认,不再往下执行,也就是说查找窗口的语句根本没有执行到。 > > > > > > > > > > > > > > > > > > 解决的方法,用线程去执行 ie.buttonClick ("install") 试试 > > > > > > > > > > > > > > > > > > 在 06-4-19,xianglong yin< yinxianglong at gmail.com> 写道: > > > > > > > > > > > > > > > > > > > > 对啊,内部网页。这个内部的网页是需要安装证书这些,很麻烦的。 > > > > > > > > > > > > > > > > > > > > 但是我在用pamie测试文件浏览对话框时也不能找到, > > > > > > > > > > 例如: > > > > > > > > > > 网页文件(1.html): > > > > > > > > > >
> > > > > > name="installForm"> > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > python代码如下: > > > > > > > > > > import cPAMIE, winGuiAuto > > > > > > > > > > > > > > > > > > > > ie = cPAMIE.PAMIE() > > > > > > > > > > wga = winGuiAuto > > > > > > > > > > # 登录 > > > > > > > > > > ie.navigate("d:\\1.html") > > > > > > > > > > ie.buttonClick("install") > > > > > > > > > > > > > > > > > #点击上面的按钮"install"之后,有一个"文件选择"的对话框弹出来,就需要控制对话框上的控件了 > > > > > > > > > > # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。 > > > > > > > > > > hwnd = wga.findTopWindow (wantedText="选择文件") > > > > > > > > > > # 点击取消按钮 > > > > > > > > > > cancelButton = wga.findControl(hwnd, > wantedClass="Button", > > > > > > > > > > wantedText="取消") > > > > > > > > > > clickButton(cancelButton ) > > > > > > > > > > > > > > > > > > > > 这段python代码不能找到 "选择文件"的对话框。 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 在06-4-19,tocer < tocer.deng at gmail.com> 写道: > > > > > > > > > > > 从程序上看不出什么错误,你那个网页是内部网页么?有没有相似的网站,我上去试试? > > > > > > > > > > > > > > > > > > > > > > 在 06-4-19,xianglong yin< yinxianglong at gmail.com> 写道: > > > > > > > > > > > > > > > > > > > > > > > > 我的代码是这样的 > > > > > > > > > > > > import cPAMIE, winGuiAuto > > > > > > > > > > > > > > > > > > > > > > > > ie = cPAMIE.PAMIE () > > > > > > > > > > > > wga = winGuiAuto > > > > > > > > > > > > # 登录 > > > > > > > > > > > > ie.navigate(" http://192.168.28.130:10003/exp ") > > > > > > > > > > > > ie.textBoxSet ("{actionForm.userName }", "0102") > > > > > > > > > > > > ie.textBoxSet ("{actionForm.userPwd}", "01020000") > > > > > > > > > > > > ie.textBoxSet ("{actionForm.instCode}", > "01020000") > > > > > > > > > > > > > > > > #点击下面按钮"I1"之后,有一个"证书选择"的对话框弹出来,就需要点击对话框上的确定 > > > > > > > > > > > > ie.buttonClick ("I1") > > > > > > > > > > > > # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。 > > > > > > > > > > > > hwnd = wga.findTopWindow(wantedText="证书选择")# > > > > > > > > > > > > okButton = wga.findControl(hwnd, > wantedClass="Button", > > > > > > > > > > wantedText="确定") > > > > > > > > > > > > clickButton(okButton) > > > > > > > > > > > > > > > > > > > > > > > > 请帮我找找问题,多谢各位! > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 在06-4-18,tocer < tocer.deng at gmail.com > 写道: > > > > > > > > > > > > > 代码贴出来看看 > > > > > > > > > > > > > > > > > > > > > > > > > > 在 06-4-17,xianglong yin< yinxianglong at gmail.com > > 写道: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 我在用pamie做网页表单测试的时候,遇到了需要处理弹出对话框,比如 > > > > > > > > > > > > > > "证书选择"、"选择文件"、"保存文件"的对话框。 > > > > > > > > > > > > > > 我根据网上的一些资料采用winGuiAuto的方法 > > > > > > > > > > > > > > > > > > findTopWindow(wantedText="证书选择")来处理,老是失败。 > > > > > > > > > > > > > > 而且我也采用转码的方式: > > > > > > > > > > > > > > findTopWindow(wantedText=u"证书选择") > > > > > > > > > > > > > > > > > > > > > > > > > > > > findTopWindow(wantedText=r"证书选择") > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > findTopWindow(wantedText=unicode("证书选择","cp936")) > > > > > > > > > > > > > > 等等转码方式都试过了,依然不能 通过findTopWindow来找到弹出窗口。 > > > > > > > > > > > > > > > > > > > > > > > > > > > > 希望大家能给予我帮助,感激不尽!! > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > > > > python-chinese > > > > > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > > > python-chinese > > > > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > > python-chinese > > > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > python-chinese > > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > python-chinese > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > python-chinese > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > Subscribe: send subscribe to > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > Detail Info: > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > python-chinese > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > Subscribe: send subscribe to > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > Detail Info: > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > python-chinese > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > Subscribe: send subscribe to > > > > > > python-chinese-request at lists.python.cn > > > > > > > Unsubscribe: send unsubscribe to > > > > > > python-chinese-request at lists.python.cn > > > > > > > Detail Info: > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > python-chinese > > > > > > Post: send python-chinese at lists.python.cn > > > > > > Subscribe: send subscribe to > > > > > > python-chinese-request at lists.python.cn > > > > > > Unsubscribe: send unsubscribe to > > > > > > python-chinese-request at lists.python.cn > > > > > > Detail Info: > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > python-chinese > > > > > Post: send python-chinese at lists.python.cn > > > > > Subscribe: send subscribe to > > > > python-chinese-request at lists.python.cn > > > > > Unsubscribe: send unsubscribe to > > > > python-chinese-request at lists.python.cn > > > > > Detail Info: > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > python-chinese > > > > Post: send python-chinese at lists.python.cn > > > > Subscribe: send subscribe to > > > > python-chinese-request at lists.python.cn > > > > Unsubscribe: send unsubscribe to > > > > python-chinese-request at lists.python.cn > > > > Detail Info: > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese at lists.python.cn > > > Subscribe: send subscribe to > python-chinese-request at lists.python.cn > > > Unsubscribe: send unsubscribe to > python-chinese-request at lists.python.cn > > > Detail Info: > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to > python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to > python-chinese-request at lists.python.cn > Detail Info: > http://python.cn/mailman/listinfo/python-chinese > >

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年04月20日 星期四 18:01

tocer tocer.deng at gmail.com
Thu Apr 20 18:01:09 HKT 2006

在 06-4-20,tocer<tocer.deng at gmail.com> 写道:
> 用qq说吧:578205792,否则太累
> 关键字:python
>
> 在 06-4-20,xianglong yin<yinxianglong at gmail.com> 写道:
> > maxthon
> >
> >
> > 在06-4-20,xianglong yin <yinxianglong at gmail.com> 写道:
> > >
> > > tocer你是在ie上运行还是在其他浏览器上面运行?我用的mathon
> > >
> > >
> > >
> > > 在06-4-20,tocer <tocer.deng at gmail.com> 写道:
> > > > 这个就不知道了,我写的测试程序,在我这里很正常
> > > >
> > > > 在 06-4-20,xianglong yin< yinxianglong at gmail.com > 写道:
> > > > >
> > > > > 啊哦,我没有发现呢!我这里只弹出了一个 文件选择的对话框,然后就不动了,什么都没有!
> > > > >
> > > > >
> > > > >
> > > > > 在06-4-20,tocer < tocer.deng at gmail.com> 写道:
> > > > > > 目前已经完成了
> > python自动点击对话框上面的"取消"按钮。也许太快了,你没有发现有一个窗口一闪就过去了?
> > > > > >
> > > > > > #这一句就是告诉系统自动点"取消"按钮
> > > > > > clickCancel = cModalPopUp.handlePopup("Confirm","取消")
> > > > > >
> > > > > > 不用再添加别的语句了
> > > > > >
> > > > > > 再仔细看看 cModalPopup 模块吧
> > > > > >
> > > > > > 在 06-4-20,xianglong yin< yinxianglong at gmail.com> 写道:
> > > > > > >
> > > > > > > 哈哈,tocer的确太棒了!
> > > > > > >
> > > > > > > 我刚刚测试已经不出现异常了,
> > > > > > > 如果我python自动点击对话框上面的"取消"按钮,
> > > > > > > 我加了行代码
> > > > > > > clickCancel.clickControl(clickCancel,"取消")
> > > > > > > 但是运行起来没有反应啊(也就是 python程序没有去点击取消按钮),
> > > > > > >
> > > > > > > 我应该怎么做呢?
> > > > > > > 多谢tocer大哥啦
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > 在06-4-20,tocer < tocer.deng at gmail.com > 写道:
> > > > > > > > 用附件中的文件覆盖原文件。下面是测试程序
> > > > > > > >
> > > > > > > > 网页文件(1.html):
> > > > > > > > 
> > name="installForm"> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > from pamie20 import cPAMIE, cModalPopUp, winGuiAuto > > > > > > > > import time > > > > > > > > > > > > > > > > ie = cPAMIE.PAMIE() > > > > > > > > wga = winGuiAuto > > > > > > > > # 登录 > > > > > > > > ie.navigate ("c:\\1.html") > > > > > > > > clickCancel = cModalPopUp.handlePopup("Confirm","取消") > > > > > > > > clickCancel.setPopupName("选择文件") //设置弹出窗体的标题 > > > > > > > > clickCancel.start () //启动新的进程 > > > > > > > > ie.buttonClick("install") > > > > > > > > time.sleep(1) > > > > > > > > clickCancel.join() //进程结束 > > > > > > > > > > > > > > > > 原模块把popupname写死了,在非英语系统中,就会发生找不到窗口的问题。 > > > > > > > > 你要感谢我的话,帮我给原作者写封信吧,请他改正这个问题。 > > > > > > > > > > > > > > > > 在 06-4-20,xianglong yin< yinxianglong at gmail.com > 写道: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 可以给我一些范例代码吗?因为我用pamie2.0包里面的buildCert.py文件做测试,它里面就用线程实现的,但是依然不能识别中文的"确认"按钮。 > > > > > > > > > 谢谢tocer大哥 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 在06-4-19,tocer < tocer.deng at gmail.com> 写道: > > > > > > > > > > 问题的原因是: > > > > > > > > > > 执行到 ie.buttonClick("install") > > > > > > > > > > > > 这一句的时候,程序停下来等待客户确认,不再往下执行,也就是说查找窗口的语句根本没有执行到。 > > > > > > > > > > > > > > > > > > > > 解决的方法,用线程去执行 ie.buttonClick ("install") 试试 > > > > > > > > > > > > > > > > > > > > 在 06-4-19,xianglong yin< yinxianglong at gmail.com> 写道: > > > > > > > > > > > > > > > > > > > > > > 对啊,内部网页。这个内部的网页是需要安装证书这些,很麻烦的。 > > > > > > > > > > > > > > > > > > > > > > 但是我在用pamie测试文件浏览对话框时也不能找到, > > > > > > > > > > > 例如: > > > > > > > > > > > 网页文件(1.html): > > > > > > > > > > >
> > > > > > > name="installForm"> > > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > python代码如下: > > > > > > > > > > > import cPAMIE, winGuiAuto > > > > > > > > > > > > > > > > > > > > > > ie = cPAMIE.PAMIE() > > > > > > > > > > > wga = winGuiAuto > > > > > > > > > > > # 登录 > > > > > > > > > > > ie.navigate("d:\\1.html") > > > > > > > > > > > ie.buttonClick("install") > > > > > > > > > > > > > > > > > > > > #点击上面的按钮"install"之后,有一个"文件选择"的对话框弹出来,就需要控制对话框上的控件了 > > > > > > > > > > > # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。 > > > > > > > > > > > hwnd = wga.findTopWindow (wantedText="选择文件") > > > > > > > > > > > # 点击取消按钮 > > > > > > > > > > > cancelButton = wga.findControl(hwnd, > > wantedClass="Button", > > > > > > > > > > > wantedText="取消") > > > > > > > > > > > clickButton(cancelButton ) > > > > > > > > > > > > > > > > > > > > > > 这段python代码不能找到 "选择文件"的对话框。 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 在06-4-19,tocer < tocer.deng at gmail.com> 写道: > > > > > > > > > > > > 从程序上看不出什么错误,你那个网页是内部网页么?有没有相似的网站,我上去试试? > > > > > > > > > > > > > > > > > > > > > > > > 在 06-4-19,xianglong yin< yinxianglong at gmail.com> 写道: > > > > > > > > > > > > > > > > > > > > > > > > > > 我的代码是这样的 > > > > > > > > > > > > > import cPAMIE, winGuiAuto > > > > > > > > > > > > > > > > > > > > > > > > > > ie = cPAMIE.PAMIE () > > > > > > > > > > > > > wga = winGuiAuto > > > > > > > > > > > > > # 登录 > > > > > > > > > > > > > ie.navigate(" http://192.168.28.130:10003/exp ") > > > > > > > > > > > > > ie.textBoxSet ("{actionForm.userName }", "0102") > > > > > > > > > > > > > ie.textBoxSet ("{actionForm.userPwd}", "01020000") > > > > > > > > > > > > > ie.textBoxSet ("{actionForm.instCode}", > > "01020000") > > > > > > > > > > > > > > > > > > #点击下面按钮"I1"之后,有一个"证书选择"的对话框弹出来,就需要点击对话框上的确定 > > > > > > > > > > > > > ie.buttonClick ("I1") > > > > > > > > > > > > > # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。 > > > > > > > > > > > > > hwnd = wga.findTopWindow(wantedText="证书选择")# > > > > > > > > > > > > > okButton = wga.findControl(hwnd, > > wantedClass="Button", > > > > > > > > > > > wantedText="确定") > > > > > > > > > > > > > clickButton(okButton) > > > > > > > > > > > > > > > > > > > > > > > > > > 请帮我找找问题,多谢各位! > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 在06-4-18,tocer < tocer.deng at gmail.com > 写道: > > > > > > > > > > > > > > 代码贴出来看看 > > > > > > > > > > > > > > > > > > > > > > > > > > > > 在 06-4-17,xianglong yin< yinxianglong at gmail.com > > > 写道: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 我在用pamie做网页表单测试的时候,遇到了需要处理弹出对话框,比如 > > > > > > > > > > > > > > > "证书选择"、"选择文件"、"保存文件"的对话框。 > > > > > > > > > > > > > > > 我根据网上的一些资料采用winGuiAuto的方法 > > > > > > > > > > > > > > > > > > > > findTopWindow(wantedText="证书选择")来处理,老是失败。 > > > > > > > > > > > > > > > 而且我也采用转码的方式: > > > > > > > > > > > > > > > findTopWindow(wantedText=u"证书选择") > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > findTopWindow(wantedText=r"证书选择") > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > findTopWindow(wantedText=unicode("证书选择","cp936")) > > > > > > > > > > > > > > > 等等转码方式都试过了,依然不能 通过findTopWindow来找到弹出窗口。 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 希望大家能给予我帮助,感激不尽!! > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > > > > > python-chinese > > > > > > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > > > > python-chinese > > > > > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > > > python-chinese > > > > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > > python-chinese > > > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > python-chinese > > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > python-chinese > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > Detail Info: > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > python-chinese > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > Detail Info: > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > python-chinese > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > Subscribe: send subscribe to > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > Detail Info: > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > python-chinese > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > Subscribe: send subscribe to > > > > > > > python-chinese-request at lists.python.cn > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > python-chinese-request at lists.python.cn > > > > > > > Detail Info: > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > python-chinese > > > > > > Post: send python-chinese at lists.python.cn > > > > > > Subscribe: send subscribe to > > > > > python-chinese-request at lists.python.cn > > > > > > Unsubscribe: send unsubscribe to > > > > > python-chinese-request at lists.python.cn > > > > > > Detail Info: > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > python-chinese > > > > > Post: send python-chinese at lists.python.cn > > > > > Subscribe: send subscribe to > > > > > python-chinese-request at lists.python.cn > > > > > Unsubscribe: send unsubscribe to > > > > > python-chinese-request at lists.python.cn > > > > > Detail Info: > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > python-chinese > > > > Post: send python-chinese at lists.python.cn > > > > Subscribe: send subscribe to > > python-chinese-request at lists.python.cn > > > > Unsubscribe: send unsubscribe to > > python-chinese-request at lists.python.cn > > > > Detail Info: > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese at lists.python.cn > > Subscribe: send subscribe to > > python-chinese-request at lists.python.cn > > Unsubscribe: send unsubscribe to > > python-chinese-request at lists.python.cn > > Detail Info: > > http://python.cn/mailman/listinfo/python-chinese > > > > >

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年04月20日 星期四 18:17

tocer tocer.deng at gmail.com
Thu Apr 20 18:17:59 HKT 2006

用附件覆盖原程序。

测试程序也改了一点。运行一下,然后把打印结果发过来

python:

import cPAMIE, cModalPopUp, winGuiAuto
import time

ie = cPAMIE.PAMIE()
wga = winGuiAuto

# 登录
ie.navigate('D:\\python\\WebDialogTest\\1.html')

#启动新的进程,自动点击"取消"
clickCancel = cModalPopUp.handlePopup("Confirm","取消")
clickCancel.popupName = "选择文件"
clickCancel.start()

ie.buttonClick("install")
time.sleep(1)

clickCancel.join() #进程结束


在 06-4-20,tocer<tocer.deng at gmail.com> 写道:
> 在 06-4-20,tocer<tocer.deng at gmail.com> 写道:
> > 用qq说吧:578205792,否则太累
> > 关键字:python
> >
> > 在 06-4-20,xianglong yin<yinxianglong at gmail.com> 写道:
> > > maxthon
> > >
> > >
> > > 在06-4-20,xianglong yin <yinxianglong at gmail.com> 写道:
> > > >
> > > > tocer你是在ie上运行还是在其他浏览器上面运行?我用的mathon
> > > >
> > > >
> > > >
> > > > 在06-4-20,tocer <tocer.deng at gmail.com> 写道:
> > > > > 这个就不知道了,我写的测试程序,在我这里很正常
> > > > >
> > > > > 在 06-4-20,xianglong yin< yinxianglong at gmail.com > 写道:
> > > > > >
> > > > > > 啊哦,我没有发现呢!我这里只弹出了一个 文件选择的对话框,然后就不动了,什么都没有!
> > > > > >
> > > > > >
> > > > > >
> > > > > > 在06-4-20,tocer < tocer.deng at gmail.com> 写道:
> > > > > > > 目前已经完成了
> > > python自动点击对话框上面的"取消"按钮。也许太快了,你没有发现有一个窗口一闪就过去了?
> > > > > > >
> > > > > > > #这一句就是告诉系统自动点"取消"按钮
> > > > > > > clickCancel = cModalPopUp.handlePopup("Confirm","取消")
> > > > > > >
> > > > > > > 不用再添加别的语句了
> > > > > > >
> > > > > > > 再仔细看看 cModalPopup 模块吧
> > > > > > >
> > > > > > > 在 06-4-20,xianglong yin< yinxianglong at gmail.com> 写道:
> > > > > > > >
> > > > > > > > 哈哈,tocer的确太棒了!
> > > > > > > >
> > > > > > > > 我刚刚测试已经不出现异常了,
> > > > > > > > 如果我python自动点击对话框上面的"取消"按钮,
> > > > > > > > 我加了行代码
> > > > > > > > clickCancel.clickControl(clickCancel,"取消")
> > > > > > > > 但是运行起来没有反应啊(也就是 python程序没有去点击取消按钮),
> > > > > > > >
> > > > > > > > 我应该怎么做呢?
> > > > > > > > 多谢tocer大哥啦
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > 在06-4-20,tocer < tocer.deng at gmail.com > 写道:
> > > > > > > > > 用附件中的文件覆盖原文件。下面是测试程序
> > > > > > > > >
> > > > > > > > > 网页文件(1.html):
> > > > > > > > > 
> > > name="installForm"> > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > from pamie20 import cPAMIE, cModalPopUp, winGuiAuto > > > > > > > > > import time > > > > > > > > > > > > > > > > > > ie = cPAMIE.PAMIE() > > > > > > > > > wga = winGuiAuto > > > > > > > > > # 登录 > > > > > > > > > ie.navigate ("c:\\1.html") > > > > > > > > > clickCancel = cModalPopUp.handlePopup("Confirm","取消") > > > > > > > > > clickCancel.setPopupName("选择文件") //设置弹出窗体的标题 > > > > > > > > > clickCancel.start () //启动新的进程 > > > > > > > > > ie.buttonClick("install") > > > > > > > > > time.sleep(1) > > > > > > > > > clickCancel.join() //进程结束 > > > > > > > > > > > > > > > > > > 原模块把popupname写死了,在非英语系统中,就会发生找不到窗口的问题。 > > > > > > > > > 你要感谢我的话,帮我给原作者写封信吧,请他改正这个问题。 > > > > > > > > > > > > > > > > > > 在 06-4-20,xianglong yin< yinxianglong at gmail.com > 写道: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 可以给我一些范例代码吗?因为我用pamie2.0包里面的buildCert.py文件做测试,它里面就用线程实现的,但是依然不能识别中文的"确认"按钮。 > > > > > > > > > > 谢谢tocer大哥 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 在06-4-19,tocer < tocer.deng at gmail.com> 写道: > > > > > > > > > > > 问题的原因是: > > > > > > > > > > > 执行到 ie.buttonClick("install") > > > > > > > > > > > > > > 这一句的时候,程序停下来等待客户确认,不再往下执行,也就是说查找窗口的语句根本没有执行到。 > > > > > > > > > > > > > > > > > > > > > > 解决的方法,用线程去执行 ie.buttonClick ("install") 试试 > > > > > > > > > > > > > > > > > > > > > > 在 06-4-19,xianglong yin< yinxianglong at gmail.com> 写道: > > > > > > > > > > > > > > > > > > > > > > > > 对啊,内部网页。这个内部的网页是需要安装证书这些,很麻烦的。 > > > > > > > > > > > > > > > > > > > > > > > > 但是我在用pamie测试文件浏览对话框时也不能找到, > > > > > > > > > > > > 例如: > > > > > > > > > > > > 网页文件(1.html): > > > > > > > > > > > >
> > > > > > > > name="installForm"> > > > > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > python代码如下: > > > > > > > > > > > > import cPAMIE, winGuiAuto > > > > > > > > > > > > > > > > > > > > > > > > ie = cPAMIE.PAMIE() > > > > > > > > > > > > wga = winGuiAuto > > > > > > > > > > > > # 登录 > > > > > > > > > > > > ie.navigate("d:\\1.html") > > > > > > > > > > > > ie.buttonClick("install") > > > > > > > > > > > > > > > > > > > > > > > #点击上面的按钮"install"之后,有一个"文件选择"的对话框弹出来,就需要控制对话框上的控件了 > > > > > > > > > > > > # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。 > > > > > > > > > > > > hwnd = wga.findTopWindow (wantedText="选择文件") > > > > > > > > > > > > # 点击取消按钮 > > > > > > > > > > > > cancelButton = wga.findControl(hwnd, > > > wantedClass="Button", > > > > > > > > > > > > wantedText="取消") > > > > > > > > > > > > clickButton(cancelButton ) > > > > > > > > > > > > > > > > > > > > > > > > 这段python代码不能找到 "选择文件"的对话框。 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 在06-4-19,tocer < tocer.deng at gmail.com> 写道: > > > > > > > > > > > > > 从程序上看不出什么错误,你那个网页是内部网页么?有没有相似的网站,我上去试试? > > > > > > > > > > > > > > > > > > > > > > > > > > 在 06-4-19,xianglong yin< yinxianglong at gmail.com> 写道: > > > > > > > > > > > > > > > > > > > > > > > > > > > > 我的代码是这样的 > > > > > > > > > > > > > > import cPAMIE, winGuiAuto > > > > > > > > > > > > > > > > > > > > > > > > > > > > ie = cPAMIE.PAMIE () > > > > > > > > > > > > > > wga = winGuiAuto > > > > > > > > > > > > > > # 登录 > > > > > > > > > > > > > > ie.navigate(" http://192.168.28.130:10003/exp ") > > > > > > > > > > > > > > ie.textBoxSet ("{actionForm.userName }", "0102") > > > > > > > > > > > > > > ie.textBoxSet ("{actionForm.userPwd}", "01020000") > > > > > > > > > > > > > > ie.textBoxSet ("{actionForm.instCode}", > > > "01020000") > > > > > > > > > > > > > > > > > > > > #点击下面按钮"I1"之后,有一个"证书选择"的对话框弹出来,就需要点击对话框上的确定 > > > > > > > > > > > > > > ie.buttonClick ("I1") > > > > > > > > > > > > > > # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。 > > > > > > > > > > > > > > hwnd = wga.findTopWindow(wantedText="证书选择")# > > > > > > > > > > > > > > okButton = wga.findControl(hwnd, > > > wantedClass="Button", > > > > > > > > > > > > wantedText="确定") > > > > > > > > > > > > > > clickButton(okButton) > > > > > > > > > > > > > > > > > > > > > > > > > > > > 请帮我找找问题,多谢各位! > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 在06-4-18,tocer < tocer.deng at gmail.com > 写道: > > > > > > > > > > > > > > > 代码贴出来看看 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 在 06-4-17,xianglong yin< yinxianglong at gmail.com > > > > 写道: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 我在用pamie做网页表单测试的时候,遇到了需要处理弹出对话框,比如 > > > > > > > > > > > > > > > > "证书选择"、"选择文件"、"保存文件"的对话框。 > > > > > > > > > > > > > > > > 我根据网上的一些资料采用winGuiAuto的方法 > > > > > > > > > > > > > > > > > > > > > > findTopWindow(wantedText="证书选择")来处理,老是失败。 > > > > > > > > > > > > > > > > 而且我也采用转码的方式: > > > > > > > > > > > > > > > > findTopWindow(wantedText=u"证书选择") > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > findTopWindow(wantedText=r"证书选择") > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > findTopWindow(wantedText=unicode("证书选择","cp936")) > > > > > > > > > > > > > > > > 等等转码方式都试过了,依然不能 通过findTopWindow来找到弹出窗口。 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 希望大家能给予我帮助,感激不尽!! > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > > > > > > python-chinese > > > > > > > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > > > > > python-chinese > > > > > > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > > > > python-chinese > > > > > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > > > python-chinese > > > > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > > python-chinese > > > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > python-chinese > > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > Detail Info: > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > python-chinese > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > Detail Info: > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > python-chinese > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > Subscribe: send subscribe to > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > Detail Info: > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > python-chinese > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > Subscribe: send subscribe to > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > Detail Info: > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > python-chinese > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > Subscribe: send subscribe to > > > > > > python-chinese-request at lists.python.cn > > > > > > > Unsubscribe: send unsubscribe to > > > > > > python-chinese-request at lists.python.cn > > > > > > > Detail Info: > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > python-chinese > > > > > > Post: send python-chinese at lists.python.cn > > > > > > Subscribe: send subscribe to > > > > > > python-chinese-request at lists.python.cn > > > > > > Unsubscribe: send unsubscribe to > > > > > > python-chinese-request at lists.python.cn > > > > > > Detail Info: > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > python-chinese > > > > > Post: send python-chinese at lists.python.cn > > > > > Subscribe: send subscribe to > > > python-chinese-request at lists.python.cn > > > > > Unsubscribe: send unsubscribe to > > > python-chinese-request at lists.python.cn > > > > > Detail Info: > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese at lists.python.cn > > > Subscribe: send subscribe to > > > python-chinese-request at lists.python.cn > > > Unsubscribe: send unsubscribe to > > > python-chinese-request at lists.python.cn > > > Detail Info: > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > -------------- next part -------------- """ cModalPopUp.py Revised: Jan 9th 2006 Developer: plhdpk Description: Class to handle pop up windows Licence: GNU General Public License (GPL) This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. """ import cPAMIE import winGuiAuto import win32gui import time import os, sys import warnings import threading import traceback import pprint warnings.filterwarnings("ignore") class handlePopup(threading.Thread): """ Construct a popup handler thread. parameters: type - The type of popup to expect. *args - One or more arguments to handle the popup, usually just a control name such as 'OK' or 'Cancel' works but sometimes a file name or string is needed as well. """ showDebugging = True # Show debug print lines? def __init__(self, type, *args): threading.Thread.__init__(self); self.wga = winGuiAuto; self.wn = win32gui; self.popupType = type; if type == 'ChooseFile': self.command = self.enterTextAndClickControl; self.popupName = 'Choose File'; self.args = args; elif type == 'Alert': self.command = self.clickControl; self.popupName = 'Microsoft Internet Explorer'; self.args = args; elif type == 'Confirm': self.command = self.clickControl; self.popupName = 'Microsoft Internet Explorer'; self.args = args; elif type == 'Prompt': self.command = self.enterTextAndClickControl; self.popupName = 'Explorer User Prompt'; self.args = args; else: self.command = self.clickControl; self.popupName = 'Microsoft Internet Explorer' self.args = 'Cancel;' def run(self): """ Override Threading's run() method. Finds the dialog and calls the required command with the arguments supplied in the constructor. TODO: Need to find an exit strategy if the dialog is not found. parameters: None returns: Nothing """ count = 10 while(count 0): time.sleep(1); try: hwnd = self.wn.FindWindow("#32770", self.popupName) try: apply(self.command, (hwnd, self.args,)) time.sleep(1) return except: if self.showDebugging: (ErrorType,ErrorValue,ErrorTB)=sys.exc_info() print sys.exc_info() traceback.print_exc(ErrorTB) except: pass count -= 1; return def enterTextAndClickControl(self, hwnd, args): """ Used for file choosers or prompt dialogs that enter text into a text box. parameters: hwnd: - The handle to the dialog. args[0] - The text to set in the text box in the dialog. args[1] - The button control name. returns: Nothing """ text=args[0]; control=args[1]; if self.showDebugging: print "Text and Control is: %s %s" %(text, control) x = self.wga.dumpWindow(hwnd) # dump out all the controls pprint.pprint(x) # print out all the controls inputBox = self.wga.findControl(hwnd, wantedClass="Edit") self.wga.setEditText(inputBox, text) time.sleep(.5) buttons = self.wga.findControls(hwnd, wantedClass="Button", wantedText=control) for b in buttons: self.wga.clickButton(b) def clickControl(self, hwnd, args): """ Used for simple dialogs that just have buttons such as 'ok', 'cancel' or 'clear'. parameters: hwnd: - The handle to the dialog. args[0] - The button control name. returns: Nothing """ controlText = args[0]; if self.showDebugging: x = self.wga.dumpWindow(hwnd) # dump out all the controls print "in clickControl, list all controls of special window:" pprint.pprint(x) # print out all the controls button = self.wga.findControl(hwnd, wantedClass="Button", wantedText=controlText) print "handle of Button=", button self.wga.clickButton(button)

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年04月20日 星期四 19:32

xianglong yin yinxianglong at gmail.com
Thu Apr 20 19:32:43 HKT 2006

控制台循环显示了如下内容:
in clickControl, list all controls of special window:
[[1706994, '\xb2\xe9\xd5\xd2\xb7\xb6\xce\xa7(&I;):', 'Static'],
 [1706988, u'', 'ComboBox'],
 [1641428, u'', 'Static'],
 [1575734, u'', 'ToolbarWindow32'],
 [1772464, u'', 'ToolbarWindow32'],
 [1641398, u'', 'ListBox'],
 [1248240,
  u'',
  'SHELLDLL_DefView',
  [[2427892, 'FolderView', 'SysListView32']]],
 [2427892, 'FolderView', 'SysListView32'],
 [2231166, '\xce\xc4\xbc\xfe\xc3\xfb(&N;):', 'Static'],
 [1706978,
  u'',
  'ComboBoxEx32',
  [[2689866, u'', 'ComboBox', [[2100168, u'', 'Edit']]],
   [2100168, u'', 'Edit']]],
 [2689866, u'', 'ComboBox', [[2100168, u'', 'Edit']]],
 [2100168, u'', 'Edit'],
 [1903442, '\xce\xc4\xbc\xfe\xc0\xe0\xd0\xcd(&T;):', 'Static'],
 [1838052, u'', 'ComboBox'],
 [1575834,
  '\xd2\xd4\xd6\xbb\xb6\xc1\xb7\xbd\xca\xbd\xb4\xf2\xbf\xaa(&R;)',
  'Button'],
 [1706900, '\xb4\xf2\xbf\xaa(&O;)', 'Button'],
 [4655986, '\xc8\xa1\xcf\xfb', 'Button'],
 [1706870, '\xb0\xef\xd6\xfa(&H;)', 'Button'],
 [2427736, u'', 'ScrollBar']]
(, , )
Traceback (most recent call last):
  File "C:\Python24\lib\cModalPopUp.py", line 84, in run
    apply(self.command, (hwnd, self.args,))
  File "C:\Python24\lib\cModalPopUp.py", line 138, in clickControl
    wantedText=controlText)
  File "C:\Python24\lib\winGuiAuto.py", line 167, in findControl
    selectionFunction=selectionFunction)
  File "C:\Python24\lib\winGuiAuto.py", line 235, in findControls
    return searchChildWindows(topHwnd)
  File "C:\Python24\lib\winGuiAuto.py", line 223, in searchChildWindows
    if wantedText and \
TypeError: 'in ' requires string as left operand





在06-4-20,tocer <tocer.deng at gmail.com> 写道:
>
> 用附件覆盖原程序。
>
> 测试程序也改了一点。运行一下,然后把打印结果发过来
>
> python:
>
> import cPAMIE, cModalPopUp, winGuiAuto
> import time
>
> ie = cPAMIE.PAMIE()
> wga = winGuiAuto
>
> # 登录
> ie.navigate('D:\\python\\WebDialogTest\\1.html')
>
> #启动新的进程,自动点击"取消"
> clickCancel = cModalPopUp.handlePopup("Confirm","取消")
> clickCancel.popupName = "选择文件"
> clickCancel.start()
>
> ie.buttonClick("install")
> time.sleep(1)
>
> clickCancel.join() #进程结束
>
>
> 在 06-4-20,tocer<tocer.deng at gmail.com> 写道:
> > 在 06-4-20,tocer<tocer.deng at gmail.com> 写道:
> > > 用qq说吧:578205792,否则太累
> > > 关键字:python
> > >
> > > 在 06-4-20,xianglong yin<yinxianglong at gmail.com> 写道:
> > > > maxthon
> > > >
> > > >
> > > > 在06-4-20,xianglong yin <yinxianglong at gmail.com> 写道:
> > > > >
> > > > > tocer你是在ie上运行还是在其他浏览器上面运行?我用的mathon
> > > > >
> > > > >
> > > > >
> > > > > 在06-4-20,tocer <tocer.deng at gmail.com> 写道:
> > > > > > 这个就不知道了,我写的测试程序,在我这里很正常
> > > > > >
> > > > > > 在 06-4-20,xianglong yin< yinxianglong at gmail.com > 写道:
> > > > > > >
> > > > > > > 啊哦,我没有发现呢!我这里只弹出了一个 文件选择的对话框,然后就不动了,什么都没有!
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > 在06-4-20,tocer < tocer.deng at gmail.com> 写道:
> > > > > > > > 目前已经完成了
> > > > python自动点击对话框上面的"取消"按钮。也许太快了,你没有发现有一个窗口一闪就过去了?
> > > > > > > >
> > > > > > > > #这一句就是告诉系统自动点"取消"按钮
> > > > > > > > clickCancel = cModalPopUp.handlePopup("Confirm","取消")
> > > > > > > >
> > > > > > > > 不用再添加别的语句了
> > > > > > > >
> > > > > > > > 再仔细看看 cModalPopup 模块吧
> > > > > > > >
> > > > > > > > 在 06-4-20,xianglong yin< yinxianglong at gmail.com> 写道:
> > > > > > > > >
> > > > > > > > > 哈哈,tocer的确太棒了!
> > > > > > > > >
> > > > > > > > > 我刚刚测试已经不出现异常了,
> > > > > > > > > 如果我python自动点击对话框上面的"取消"按钮,
> > > > > > > > > 我加了行代码
> > > > > > > > > clickCancel.clickControl(clickCancel,"取消")
> > > > > > > > > 但是运行起来没有反应啊(也就是 python程序没有去点击取消按钮),
> > > > > > > > >
> > > > > > > > > 我应该怎么做呢?
> > > > > > > > > 多谢tocer大哥啦
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > 在06-4-20,tocer < tocer.deng at gmail.com > 写道:
> > > > > > > > > > 用附件中的文件覆盖原文件。下面是测试程序
> > > > > > > > > >
> > > > > > > > > > 网页文件(1.html):
> > > > > > > > > > 
> > > > name="installForm"> > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > from pamie20 import cPAMIE, cModalPopUp, winGuiAuto > > > > > > > > > > import time > > > > > > > > > > > > > > > > > > > > ie = cPAMIE.PAMIE() > > > > > > > > > > wga = winGuiAuto > > > > > > > > > > # 登录 > > > > > > > > > > ie.navigate ("c:\\1.html") > > > > > > > > > > clickCancel = cModalPopUp.handlePopup("Confirm","取消") > > > > > > > > > > clickCancel.setPopupName("选择文件") //设置弹出窗体的标题 > > > > > > > > > > clickCancel.start () //启动新的进程 > > > > > > > > > > ie.buttonClick("install") > > > > > > > > > > time.sleep(1) > > > > > > > > > > clickCancel.join() //进程结束 > > > > > > > > > > > > > > > > > > > > 原模块把popupname写死了,在非英语系统中,就会发生找不到窗口的问题。 > > > > > > > > > > 你要感谢我的话,帮我给原作者写封信吧,请他改正这个问题。 > > > > > > > > > > > > > > > > > > > > 在 06-4-20,xianglong yin< yinxianglong at gmail.com > 写道: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 可以给我一些范例代码吗?因为我用pamie2.0包里面的buildCert.py文件做测试,它里面就用线程实现的,但是依然不能识别中文的"确认"按钮。 > > > > > > > > > > > 谢谢tocer大哥 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 在06-4-19,tocer < tocer.deng at gmail.com> 写道: > > > > > > > > > > > > 问题的原因是: > > > > > > > > > > > > 执行到 ie.buttonClick("install") > > > > > > > > > > > > > > > > 这一句的时候,程序停下来等待客户确认,不再往下执行,也就是说查找窗口的语句根本没有执行到。 > > > > > > > > > > > > > > > > > > > > > > > > 解决的方法,用线程去执行 ie.buttonClick ("install") 试试 > > > > > > > > > > > > > > > > > > > > > > > > 在 06-4-19,xianglong yin< yinxianglong at gmail.com> 写道: > > > > > > > > > > > > > > > > > > > > > > > > > > 对啊,内部网页。这个内部的网页是需要安装证书这些,很麻烦的。 > > > > > > > > > > > > > > > > > > > > > > > > > > 但是我在用pamie测试文件浏览对话框时也不能找到, > > > > > > > > > > > > > 例如: > > > > > > > > > > > > > 网页文件(1.html): > > > > > > > > > > > > >
> > > > > > > > > name="installForm"> > > > > > > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > python代码如下: > > > > > > > > > > > > > import cPAMIE, winGuiAuto > > > > > > > > > > > > > > > > > > > > > > > > > > ie = cPAMIE.PAMIE() > > > > > > > > > > > > > wga = winGuiAuto > > > > > > > > > > > > > # 登录 > > > > > > > > > > > > > ie.navigate("d:\\1.html") > > > > > > > > > > > > > ie.buttonClick("install") > > > > > > > > > > > > > > > > > > > > > > > > > > #点击上面的按钮"install"之后,有一个"文件选择"的对话框弹出来,就需要控制对话框上的控件了 > > > > > > > > > > > > > # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。 > > > > > > > > > > > > > hwnd = wga.findTopWindow (wantedText="选择文件") > > > > > > > > > > > > > # 点击取消按钮 > > > > > > > > > > > > > cancelButton = wga.findControl(hwnd, > > > > wantedClass="Button", > > > > > > > > > > > > > wantedText="取消") > > > > > > > > > > > > > clickButton(cancelButton ) > > > > > > > > > > > > > > > > > > > > > > > > > > 这段python代码不能找到 "选择文件"的对话框。 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 在06-4-19,tocer < tocer.deng at gmail.com> 写道: > > > > > > > > > > > > > > 从程序上看不出什么错误,你那个网页是内部网页么?有没有相似的网站,我上去试试? > > > > > > > > > > > > > > > > > > > > > > > > > > > > 在 06-4-19,xianglong yin< yinxianglong at gmail.com> > 写道: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 我的代码是这样的 > > > > > > > > > > > > > > > import cPAMIE, winGuiAuto > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ie = cPAMIE.PAMIE () > > > > > > > > > > > > > > > wga = winGuiAuto > > > > > > > > > > > > > > > # 登录 > > > > > > > > > > > > > > > ie.navigate(" > http://192.168.28.130:10003/exp ") > > > > > > > > > > > > > > > ie.textBoxSet ("{actionForm.userName }", > "0102") > > > > > > > > > > > > > > > ie.textBoxSet ("{actionForm.userPwd}", > "01020000") > > > > > > > > > > > > > > > ie.textBoxSet ("{actionForm.instCode}", > > > > "01020000") > > > > > > > > > > > > > > > > > > > > > > #点击下面按钮"I1"之后,有一个"证书选择"的对话框弹出来,就需要点击对话框上的确定 > > > > > > > > > > > > > > > ie.buttonClick ("I1") > > > > > > > > > > > > > > > # 通过winGuiAuto查找窗口,但是每次都是下面这句话报错。 > > > > > > > > > > > > > > > hwnd = wga.findTopWindow > (wantedText="证书选择")# > > > > > > > > > > > > > > > okButton = wga.findControl(hwnd, > > > > wantedClass="Button", > > > > > > > > > > > > > wantedText="确定") > > > > > > > > > > > > > > > clickButton(okButton) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 请帮我找找问题,多谢各位! > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 在06-4-18,tocer < tocer.deng at gmail.com > 写道: > > > > > > > > > > > > > > > > 代码贴出来看看 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 在 06-4-17,xianglong yin< > yinxianglong at gmail.com > > > > > 写道: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 我在用pamie做网页表单测试的时候,遇到了需要处理弹出对话框,比如 > > > > > > > > > > > > > > > > > "证书选择"、"选择文件"、"保存文件"的对话框。 > > > > > > > > > > > > > > > > > 我根据网上的一些资料采用winGuiAuto的方法 > > > > > > > > > > > > > > > > > > > > > > > > findTopWindow(wantedText="证书选择")来处理,老是失败。 > > > > > > > > > > > > > > > > > 而且我也采用转码的方式: > > > > > > > > > > > > > > > > > findTopWindow(wantedText=u"证书选择") > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > findTopWindow(wantedText=r"证书选择") > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > findTopWindow(wantedText=unicode("证书选择","cp936")) > > > > > > > > > > > > > > > > > 等等转码方式都试过了,依然不能 通过findTopWindow来找到弹出窗口。 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 希望大家能给予我帮助,感激不尽!! > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > > > > > > > python-chinese > > > > > > > > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > > > > > > python-chinese > > > > > > > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > > > > > python-chinese > > > > > > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > > > > python-chinese > > > > > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > > > python-chinese > > > > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > > python-chinese > > > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > python-chinese > > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > > Detail Info: > > > > > > > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > python-chinese > > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > > Detail Info: > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > python-chinese > > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > > Subscribe: send subscribe to > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > > Detail Info: > > > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > python-chinese > > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > > Subscribe: send subscribe to > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > python-chinese-request at lists.python.cn > > > > > > > > Detail Info: > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > python-chinese > > > > > > > Post: send python-chinese at lists.python.cn > > > > > > > Subscribe: send subscribe to > > > > > > > python-chinese-request at lists.python.cn > > > > > > > Unsubscribe: send unsubscribe to > > > > > > > python-chinese-request at lists.python.cn > > > > > > > Detail Info: > > > > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > python-chinese > > > > > > Post: send python-chinese at lists.python.cn > > > > > > Subscribe: send subscribe to > > > > python-chinese-request at lists.python.cn > > > > > > Unsubscribe: send unsubscribe to > > > > python-chinese-request at lists.python.cn > > > > > > Detail Info: > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > python-chinese > > > > Post: send python-chinese at lists.python.cn > > > > Subscribe: send subscribe to > > > > python-chinese-request at lists.python.cn > > > > Unsubscribe: send unsubscribe to > > > > python-chinese-request at lists.python.cn > > > > Detail Info: > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060420/6de446ff/attachment-0001.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号