def setUp(): # softDir=u'E:\模拟\ReleaseV1.02_20190315' reload(sys) sys.setdefaultencoding('GBK') list=readConfig.readIniConifg('Power') window_name=list[0] softDir=list[1] # softName='BatterySimulator.exe' softName=list[2] start.login(softDir, softName,window_name) start.max(window_name) app = pywin.Pywin() # window_name = u"科梁电池模拟器监控软件V1.0.2" app.connect(window_name) app.click(window_name, u'系统') #点击选定坐标基值 return (getPos.get_pos(0,0)) #返回坐标基值
import ConfigParser import os import sys import time import xml.dom.minidom import _winreg import logging from pywinauto import mouse as ms import auto_lib as pywin import exception as exp import locFun as location app=pywin.Pywin() def get_workspace(): key=_winreg.OpenKey(_winreg.HKEY_CURRENT_USER,r"Software\Keliang\QuikLab3.0") try: i=0 while 1: name,value,type=_winreg.EnumValue(key,i) print repr(name),value i+=1 except WindowsError: value,type = _winreg.QueryValueEx(key,"workspace") # print value return(value) @location._getName
import auto_lib as pywin import SendKeys import time import os import try2 from pywinauto.mouse import right_click #QuiKLab登录 # tl_dir = r'D:\Program Files\QuiKLab3.0' # tl_name = r'D:\Program Files\QuiKLab3.0\MainApp.exe' # try2.login(tl_dir,tl_name,'1') # time.sleep(2) # # #加载项目 window_name =u'QuiKLab V3.0' app=pywin.Pywin() #实例化 # try2.load_pro(window_name,'ZF-ICD-TEST') # time.sleep(2) #新建用例分类 app.connect(window_name) # app.click(window_name,u'用例分类') #点击已创建好的用例分类 # app.Sendk('RIGHT') # app.click(window_name,u'TEST') #点击TEST测试用例 # #添加用例变量 # app.click(window_name,u'测试用例变量') # app.click(window_name,u'添加信号变量') #勾选信号 # app.click(window_name,'TCP/IP') # print py.position()