python实现工具exe自动化

记录python编写的第一工具脚本。

 

脚本内容:调用工具进行循环测试。

最后使用框架:python3+uiautomation

工具:UIspy

使用UIspy查看软件的类,调用uiautomation中方法。

下面为打开IOmeter工具的脚本

subprocess.Popen('IOmeter.exe') # 打开iometer软件
window1 = auto.WindowControl(Name="Iometer")  # 进入软件
pane1 = window1.PaneControl(searchDepth=1, ClassName="AfxFrameOrView110s")
# 打开脚本文件选择框
toolname = window1.ToolBarControl(ClassName="ToolbarWindow32")
time.sleep(0.5)
openTfile = toolname.ButtonControl(Name="Open Test Configuration File")
openTfile.Click()
# 定位脚本选择框
filename = auto.WindowControl(Name="Open Test Configuration File")
fileedit = filename.EditControl(Name="文件名(N):")
fileedit.Click()
time.sleep(0.5)
fileedit.SendKeys('{Back}')

fileedit.SendKeys('savaid')
time.sleep(0.5)
fileopen = filename.ButtonControl(Name="打开(O)")
fileope
  • 0
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值