Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 编程语言 > 其他编程语言 > 使用LDTP与dogtail写的stardict的自动测试脚本
【标  题】:使用LDTP与dogtail写的stardict的自动测试脚本
【关键字】:LDTP,dogtail,stardict
【来  源】:http://www.cublog.cn/u/12325/showart.php?id=177883

使用LDTP与dogtail写的stardict的自动测试脚本

Your Ad Here

-----------
Dogtail
-----------
1  #!/usr/bin/python
2  from dogtail.config import config
3  from dogtail import tree
4  from dogtail.utils import screenshot, run
5  import dogtail.i18n
6  dogtail.i18n.loadTranslationsFromPackageMoFiles('stardict')
7
8  from time import sleep
9  from os import environ
10 environ['LANG']='en_US.UTF-8'
11
12 run('stardict')
13 treeroot = tree.root.application('stardict')
14 treeroot.button('Clear').click()
15 sleep(1)
16
17 newtxt = treeroot.child(roleName = 'text')
18 newtxt.text = "hello"
19 sleep(1)
20
21 screenshot()
22
23 treeroot.button('go back').click()
24 sleep(1)
25
26 treeroot.button('quit').click()

-------
LDTP
-------
1  #!/usr/bin/python

3  from ldtp import *
4  from ldtputils import *

6  from time import sleep
7  from os import environ
8  environ['LANG']='en_US.UTF-8'

10 launchapp('stardict')
11 try:
12     waittillguiexist('frmStarDict')
13
14     click('frmStarDict', 'btnClear')
15     sleep(1)
16
17     enterstring('frmStarDict', 'txt0', 'hello')
18     sleep(1)
19
20     imagecapture ('StarDict', 'snapshot.png')
21
22     click('frmStarDict', 'btngoback')
23     sleep(1)   
24
25     click('frmStarDict', 'btnquit')
26 except ldtp.LdtpExecutionError, x:
27     print "LdtpExecutionError: %s"%x

 

 
 
python的MySQLdb尝试:【上一篇】
数理逻辑:【下一篇】
【相关文章】
  • StarDict.org在线词典网站推出
  • stardict 音标
  • 一个简单的stardict的自动测试脚本(基于dogtail)
  • 在Suse10下尝试dogtail(一个python的GUI测试工具)的笔记(二)
  • 在Suse10下尝试dogtail(一个python的GUI测试工具)的笔记(一)
  • Linux下星际译王 stardict 的安装
  • 使用“星际译王”遇到的问题(stardict)
  • fc5安装 stardict (星际译王)词库
  • 自动测试工具——dogtail
  • Stardict Installation Notes for Solaris 10
  • 【随机文章】
  • Trolltech Announces Qtopia Greenphone
  • 对 象 清 理
  • 美国康本斩断过敏性哮喘显神效!过敏性哮喘过敏性支气管哮喘
  • 如何把图片、声音等存储到sql中
  • shell set 命令详解
  • 巧妙输入平行四边形的符号
  • Linux和Solaris建立Apache的虚拟根环境
  • OTEC IW项目成员招募中
  • 安装配置Docbook工具
  • 从 ASP.NET 服务器控件插入客户端脚本(3)
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.