SikuliX 1.1.0 Beta从安装到测试框架(2)

使用Python unittest框架的sikulix自动化测试以Demo.sikuli为例1.      启动sikulix2.      Sikuli IDE—文件—新建3.      套用Demo.py,解析如下:a)       导入默认路径根据实际情况更改公共函数:对于常用的步骤或常量,可以加入CommonBase公共库,调用方便,减少重复代码b)
摘要由CSDN通过智能技术生成

使用Python unittest框架的sikulix自动化测试

Demo.sikuli为例

1.      启动sikulix

2.      Sikuli IDE—文件—新建

3.      套用Demo.py,解析如下:

# -*- coding: utf-8 -*-
from sikuli import *
import os
import sys
sys.path.append("D:\Sikuli")
import HTMLTestRunner
import unittest
#import CommonBase

imgPath = list(getImagePath())
if CommonBase.picture_path not in imgPath:
    addImagePath(CommonBase.picture_path)

class TestDemo(unittest.TestCase):
    def setUp(self):
        if not CommonBase.queryProcess("liebao.exe"):
            CommonBase.init_env("liebao.exe")
        wait(1)
        
    def tearDown(self):
        wait(1)

    def test_01_Demo_openLiebao(self):
        click("download.png")
        wait(1)
        self.assertTrue(exists("downloadManager_title.png", 2))
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值