コード例 #1
1
    def test_search(self):
        # 运行网易云音乐
        autoit.run(self.cloudmusic_path)
        time.sleep(5)

        # 等待网易云音乐窗口激活
        autoit.win_wait_active(self.cloudmusic_title)

        # 按5下TAB切换至搜索框
        autoit.send("{TAB 5}")

        # 搜索歌曲
        autoit.send(self.song)
        time.sleep(1)

        # 按3下向下键选择第一首歌曲
        autoit.send("{DOWN 3}")
        time.sleep(1)

        # 按回车键播放歌曲
        autoit.send("{ENTER}")
        time.sleep(1)

        # 校验当前窗口标题是否含有搜索歌曲名
        title = autoit.win_get_title(self.cloudmusic_title)
        assert self.song in title, self.song.encode('utf-8') + ' not in ' + title.encode('utf-8')

        # 关闭窗口
        autoit.win_close(self.cloudmusic_title)
コード例 #2
0
ファイル: 截长图ok.py プロジェクト: 3058035655/tjf_test
    def test_pcLogin(self):
        fp = webdriver.FirefoxProfile(r"C:\Users\mhf\AppData\Roaming\Mozilla\Firefox\Profiles\cv6txwo2.default")
        driver = webdriver.Firefox(fp)
        # driver = webdriver.Firefox ()
        driver.get ("https://www.hongkunjinfu.com")
        WebDriverWait (driver, 10).until (EC.presence_of_element_located ((By.ID, 'login')))
        driver.find_element_by_id ('login').send_keys ('14510000051')
        driver.find_element_by_xpath("html/body/div[2]/div[2]/div/ul/li[1]/a").click()

        autoit.win_activate('鸿坤金服——社区金融超市 - Mozilla Firefox')
        print("1111")
        autoit.send('{LCTRL down}'+'{LSHIFT down}'+'{! down}')
        # autoit.send('{LCTRL down}' + '{LALT down}' + '{a down}')
        # driver.find_element_by_id('login').send_keys(Keys.CONTROL + Keys.SHIFT + '!')
        time.sleep(2)
        autoit.win_wait('截取的图片另存为...')
        print("2222")
        autoit.control_focus('截取的图片另存为...','1001')
        print("3333")
        autoit.win_wait("[Class:#32770]",10)
        t = datetime.now().strftime('%Y%m%d%H%M%S')
        name='金服首页'+t
        # autoit.control_set_text('截取的图片另存为...','Edit1','金服网页102')
        autoit.control_set_text('截取的图片另存为...','Edit1',name)
        autoit.control_click('截取的图片另存为...','Button2')
        driver.close()
コード例 #3
0
	def open_project(self, projectname):
		"""打开工程"""
		w0 = WinControl(self.BECivilWin)
		if w0.exists():
			w0.wait(3)
			m1 = MouseControl()
			m1.click(self.BECivilWin, '', screen_point.系统[0], screen_point.系统[1])
			m1.click(self.BECivilWin, '', screen_point.打开工程[0], screen_point.打开工程[1])
			sleep(3)
			w1 = WinControl("选择工程")
			if w1.exists():
				w1.wait(3)
				w1.setState(3)
				# 输入名字搜索
				m1.click("选择工程", '', 50, 35)
				autoit.send(projectname)
				sleep(5)
				# 打开测试脚本用土建工程
				m1.click(self.BECivilWin, '', 92, 133, clicks=3)
			else:
				raise Exception("未选中选择工程窗口")
			sleep(10)
			# 使视图视角变为俯视视角
			m1.click(self.BECivilWin, '', 440, 440, button='right')
			m1.click(self.BECivilWin, '', 490, 475)
		else:
			raise Exception("未识别BECivil窗口")
コード例 #4
0
 def select_value_from_dropdown_list(self, control_id, value_to_select):
     """ 
     Example:
     Select Value From Dropdown List | [NAME:ccboClass_1] | Class Code Sample
     """
     autoit.win_activate('Power Express')
     autoit.control_click('Power Express', control_id)
     autoit.send('{BACKSPACE}')
     autoit.send('{HOME}')
     while 1:
         item_combo_value = autoit.control_get_text('Power Express',
                                                    control_id)
         if item_combo_value == value_to_select:
             autoit.control_focus('Power Express', control_id)
             autoit.send('{ENTER}')
             autoit.send('{TAB}')
             break
         else:
             autoit.control_focus('Power Express', control_id)
             autoit.send('{DOWN}')
         if autoit.control_get_text('Power Express',
                                    control_id) == item_combo_value:
             BuiltIn().fail("Dropdown '" + value_to_select +
                            "' value is not found")
             break
コード例 #5
0
ファイル: Estorno.py プロジェクト: bopopescu/DevsON
def Estorno(Num):
    autoit.send('Entra Função Estorno')
    FuncoesBD.LocalizaCupom(Num)
    if Variaveis.Retorna == 'S':
        autoit.send("{ALTDOWN}x{ALTUP}")
        SENHAFUNC.SENHAFUNC()
        try:
            log.EscreverLog('Estorno de Venda')
            autoit.win_wait_active("[Class:TFRM_ESTORNO]", Variaveis.TTela)
            autoit.control_send("[CLASS:TFRM_ESTORNO]", "TRzNumericEdit1",
                                str(Variaveis.LocCupom))
            time.sleep(Variaveis.TDig)
            autoit.control_click("[CLASS:TFRM_ESTORNO]", "TRzBitBtn2")
            time.sleep(Variaveis.TDig)
            autoit.control_click("[CLASS:TFRM_ESTORNO]", "TVSMDBGrid1")
            time.sleep(Variaveis.TDig)
            autoit.send("{SPACE}")
            time.sleep(Variaveis.TDig)
            autoit.control_click("[CLASS:TFRM_ESTORNO]", "TRzBitBtn1")
            time.sleep(Variaveis.TAlertaB)
            autoit.send("{ENTER}")
            time.sleep(Variaveis.TAlertaB)
            autoit.send("{ENTER}")
        except:
            log.EscreverLog('Erro')
    else:
        log.EscreverLog('Cupom não encontrado')
    log.EscreverLog('Sai Função Estorno')
コード例 #6
0
def Crtx():
    Tempo.TelaAcao()
    log.EscreverLog('Entra Funçao Crt X')
    log.EscreverLog('Crt X')
    autoit.send("{CTRLDOWN}x{CTRLUP}")
    Tela.TelaAlertaCrt('Tela Vazia', 'Sem Alerta')
    log.EscreverLog('Sai Funçao Crt X')
コード例 #7
0
ファイル: Produto.py プロジェクト: bopopescu/DevsON
def Produto(Prod,Desc,Qtd,Lote):
    log.EscreverLog('Entrada Função lança produto')
    log.EscreverLog('Produto codigo: ' + str(Prod))
    autoit.send(Prod)
    Tecla.EnterProduto()
    if Variaveis.TesteRapido != 'S':
        Tela.Validacao()
        for x in range(0, 2):
            Tela.AlertaProduto('Espera Alerta', 'Sem Alerta')
        TemPromocao.TemPromocao()

    log.EscreverLog('Quantidade: ' + str((Qtd)))
    autoit.send(Qtd)
    Tecla.EnterProduto()

    if Desc != "0":
        AltW.AltW(Desc)
        for x in range(0,3):
            Tecla.Enter()
    else:
        Tecla.Enter()

    if Lote == "Pos":
        MarcarPosVenda.MarcarPosVenda()
    if Lote == "L":
        InformarLote.InformarLote(Qtd)
    if Lote == "P":
        InformarPsico.InformarPsico(Qtd)

    log.EscreverLog('Sai função Lança produto')
コード例 #8
0
def LimpaTexto():
    Tempo.Dig()
    log.EscreverLog("{HOME}")
    autoit.send("{HOME}")
    Tempo.Dig()
    log.EscreverLog("{SHIFTDOWN}{END}{SHIFTUP}{BACKSPACE}")
    autoit.send("{SHIFTDOWN}{END}{SHIFTUP}{BACKSPACE}")
コード例 #9
0
ファイル: maximizer_export.py プロジェクト: Sk00g/autobank
def export_letter(letter):
    autoit.send("#3")
    time.sleep(2.0)
    autoit.send("https://login.maximizer.com/MaxLogin")
    time.sleep(0.5)
    autoit.send("{ENTER}")
    time.sleep(3.0)
    autoit.mouse_move(2801, 421)
    time.sleep(1.0)
    # autoit.mouse_click(x=2287, y=278, speed=0)
    # time.sleep(3.0)
    autoit.mouse_click(x=2801, y=421, speed=0)
    time.sleep(5.0)
    autoit.mouse_click(x=2965, y=414, speed=0)
    time.sleep(5.0)

    autoit.mouse_click(x=2273, y=191, speed=0)
    time.sleep(1.0)
    autoit.mouse_click(x=2290, y=344, speed=0)
    time.sleep(1.0)
    autoit.send(letter + '{ENTER}')
    time.sleep(5.0)
    autoit.mouse_click(x=2112, y=186, speed=0)
    time.sleep(1.0)
    autoit.mouse_click(x=2165, y=475, speed=0)
    time.sleep(0.75)
    autoit.mouse_click(x=2481, y=186, speed=0)
    time.sleep(3.0)
    autoit.send('export_%s{ENTER}' % letter)
    time.sleep(2.0)
    autoit.mouse_click(x=3819, y=16, speed=0)
    time.sleep(1.0)
コード例 #10
0
    def test_CDR(self):
        homepage = Homepage(self.driver)
        homepage.navigate()
        signup_form = homepage.getSignupForm()
        signup_form.setName("admin", "brijesh84")

        autoit.run("C:\Program Files (x86)\Zoiper\Zoiper.exe")
        autoit.win_wait_active("Zoiper", 5)
        autoit.control_send("Zoiper", "Edit1", "121919898222221")
        time.sleep(5)
        autoit.send("{ENTER}")

        time.sleep(60)

        time.sleep(5)
        self.driver.find_element_by_css_selector(
            "li.monitoring > a > div.menu_name").click()
        time.sleep(5)
        self.driver.find_element_by_link_text("CDR Trace").click()
        time.sleep(3)
        self.driver.find_element_by_id("rdoCdrSearchType-1").click()
        self.driver.find_element_by_id("txtCustomerIPAddress").send_keys(
            "192.168.20.155")
        self.driver.find_element_by_id("cdrtracesearch").click()
        time.sleep(5)
        temp = "CDR_Print"
        self.driver.save_screenshot("%s.png" % (temp))
コード例 #11
0
ファイル: main.py プロジェクト: nourshlian/Instagram_Bot
    def post_pic(self):
        login_slct = '//*[@id="react-root"]/section/main/article/div/div/div/div[2]/button'
        username = '******'
        password = '******'
        login_btn = '//*[@id="loginForm"]/div[1]/div[6]/button'
        not_now = '//*[@id="react-root"]/section/main/div/div/div/button'
        post_btn = '//*[@id="react-root"]/section/nav[2]/div/div/div[2]/div/div/div[3]'
        next_btn = '//*[@id="react-root"]/section/div[1]/header/div/div[2]/button'
        caption_path = '//*[@id="react-root"]/section/div[2]/section[1]/div[1]/textarea'
        share_btn = '//*[@id="react-root"]/section/div[1]/header/div/div[2]/button'
        image_path = conf.IMAGE_PATH
        caption = conf.CAPTION

        mob_bot = self.open_mob_browser()
        mob_bot.wait_for(login_slct).click()
        mob_bot.wait_for(username).send_keys(self.username)
        mob_bot.wait_for(password).send_keys(self.password)
        mob_bot.wait_for(login_btn).click()
        try:
            mob_bot.wait_for(not_now).click()
        except:
            pass
        mob_bot.wait_for(post_btn).click()
        autoit.win_wait_active("Open", 5)
        autoit.send(os.getcwd() + image_path)
        autoit.send("{ENTER}")

        mob_bot.wait_for(next_btn).click()
        self.random_wait(5)
        mob_bot.wait_for(caption_path).send_keys(caption)
        mob_bot.wait_for(share_btn).click()
        sleep(10)
        mob_bot.browser.quit()
コード例 #12
0
    def send_keys_to_native_window(self, window_name, string):
        """ Send one or more keystrokes to the active window as if they were typed at the keyboard.
            This method is similar to the VB SendKeys method.
            Key          SendKey Equivalent    Description
            ~            {~}                   Send a tilde (~)
            !            {!}                   Send an exclamation point (!)
            ^            {^}                   Send a caret (^)
            +            {+}                   Send a plus sign (+)
            Alt          {ALT}                 Send an Alt keystroke
            Backspace    {BACKSPACE}           Send a Backspace keystroke
            Clear        {CLEAR}               Slear the field
            Delete       {DELETE}              Send a Delete keystroke
            Down Arrow   {DOWN}                Send a Down Arrow keystroke
            End          {END}                 Send an End keystroke
            Enter        {ENTER}               Send an Enter keystroke
            Escape       {ESCAPE}              Send an Esc keystroke
            F1 through F16    {F1} through {F16}   Send the appropriate Function key
            Page Down    {PGDN}                Send a Page Down keystroke
            Space        {SPACE}               Send a Spacebar keystroke
            Tab          {TAB}                 Send a Tab keystroke

            For SHIFT prefix with +
            For CTRL  prefix with ^
            For ALT   prefix with %
            Example:
                | Send Keys to Window | Notepad | This is a test |
        """
        # The activate_window method tries to activate an application whose title is the nearest match to strApplicationTitle.
        # https://www.autoitscript.com/autoit3/docs/functions/Send.htm
        logger.debug("Focusing native window '{0}'".format(window_name))
        self.activate_window(window_name)
        logger.debug("Sending keys to native window: '{0}'".format(string))
        autoit.send(string)
コード例 #13
0
ファイル: window.py プロジェクト: rootmap/RPA-Erase-Voucher
 def press_key(self, key, count=1, mode=0):
     if mode == 0:
         if count > 1:
             key = "{" + key + " " + str(count) + "}"
         else:
             key = "{" + key + "}"
         print(key)
     autoit.send(key, mode=0)
コード例 #14
0
ファイル: MostraDesconto.py プロジェクト: bopopescu/DevsON
def MostraDesconto():
    log.EscreverLog('Função Mostra desconto')
    log.EscreverLog('{ALT D - Mostra descontos aplicados')
    time.sleep(Variaveis.TDig)
    autoit.send("{ALTDOWN}d{ALTUP}")
    time.sleep(Variaveis.TTela)
    log.EscreverLog('{Fecha tela de descontos aplicados')
    time.sleep(Variaveis.TDig)
    autoit.send("{ESC}")
コード例 #15
0
	def add_node(self):
		"""添加钢筋节点"""
		w0 = WinControl(self.BECivilWin)
		if w0.exists():
			w0.wait(3)
			m1 = MouseControl()
			sleep(2)
			# 使视图视角变为俯视视角
			m1.click(self.BECivilWin, '', 440, 440, button='right')
			m1.click(self.BECivilWin, '', 490, 475)
			m1.click(self.BECivilWin, '', screen_point.操作[0], screen_point.操作[1])
			m1.click(self.BECivilWin, '', screen_point.插入节点[0], screen_point.插入节点[1])
			w1 = WinControl('插入节点')
			sleep(1)
			if w1.exists():
				w1.wait(3)
				# 上传文件
				m1.click('插入节点', '', 970, 360)
				sleep(1)
				w2 = WinControl('打开')
				if w2.exists():
					w2.wait(3)
					m1.click('打开', '', 1000, 50)
					w2.controlSetText('[CLASS:Edit; INSTANCE:2]', self.uploadaddress)
					autoit.send("{ENTER}")
					sleep(1)
					w2.controlSetText('[CLASS:Edit; INSTANCE:1]', '钢筋节点 (2).lbg')
					w2.controlClick('[CLASS:Button; INSTANCE:1]')
				else:
					raise Exception('未打开上传节点文件窗口')
				sleep(2)
				# 详细位置
				m1.click('插入节点', '', 970, 450)
				sleep(1)
				# 选择要插入节点的位置
				m1.click(self.BECivilWin, '', 1050, 504)
				m1.click(self.BECivilWin, '', 1050, 504, button='right')
				sleep(1)
				m1.click(self.BECivilWin, '', 1100, 514)
				sleep(2)
				w1.controlClick('[CLASS:Button; INSTANCE:1]')
				sleep(5)
				if w0.exists():
					w0.wait(3)
					t = w0.getPos()
					if t == (862, 438, 1058, 602):
						pass
					else:
						raise Exception('Something went wrong.')
					w0.controlClick('[CLASS:Button; INSTANCE:1]')
				else:
					raise Exception('节点插入未成功')
			else:
				raise Exception('未打开插入节点窗口')
		else:
			raise Exception('未识别BECivil窗口')
コード例 #16
0
ファイル: command.py プロジェクト: aantr/WindowsHostManager
def write_notepad(text):
    command('notepad.exe')
    try:
        autoit.win_wait('[CLASS:Notepad]', timeout=3)
        autoit.win_activate('[CLASS:Notepad]')
    except autoit.autoit.AutoItError as e:
        print(e)
    for i in text.split('*'):
        autoit.send(i)
        autoit.send('{enter}')
コード例 #17
0
def right_control():  # 图层右键功能
    autoit.mouse_click("Right", 93, 193, 1, 10)  # 右键点击图层,打开功能列表
    sleep(1)
    autoit.send("{down 10}")  # 选择第十行,选择属性
    sleep(1)
    autoit.send("{enter}")
    autoit.win_wait_active(u"图层属性", 5)  # 等待图层属性窗口,5秒超时
    sleep(1)
    autoit.control_click(u"图层属性", "Button2")  # 关闭图层属性
    sleep(1)
コード例 #18
0
 def _open_connect_bar(self):
     autoit.send("#k")
     time.sleep(1)
     print "1"
     time.sleep(1)
     print "2"
     time.sleep(1)
     print "3"
     time.sleep(1)
     print "4"
コード例 #19
0
ファイル: OndaDownload.py プロジェクト: 2AiBAIT/SatFire2
def insert_credentials(mydriver, lastpos, lastsize):
    mydriver.maximize_window()
    print("Login efetuado com sucesso...")
    autoit.win_wait_active("", 3)
    autoit.send(user + "{TAB}")
    autoit.send(password + "{ENTER}")
    driver.set_window_rect(lastpos["x"], lastpos["y"], lastsize["width"],
                           lastsize["height"])

    return False
コード例 #20
0
ファイル: Py_Test1.py プロジェクト: wzytest203/upload_Test
def display_control():   #显示控制模块
    autoit.mouse_click("LEFT",160,40,1,10)                      #进入显示控制模块
    sleep(1)

    '''亮度增强'''
    autoit.mouse_click_drag(119,92,150,92,"LEFT",1)             #亮度增强,向右拖拽
    sleep(1)
    autoit.mouse_click_drag(150,92,80,92,"LEFT",1)              #亮度增强,向左拖拽
    sleep(1)
    autoit.mouse_click("LEFT",60,92,1,10)                       #亮度增强,点击“-”1次
    sleep(1)
    autoit.mouse_click("LEFT",175,92,2,10)                      #亮度增强,点击“+”2次
    sleep(1)
    autoit.mouse_click("LEFT",30,92,1,10)                       #亮度增强,点击“亮度”恢复原状

    '''对比度增强'''
    autoit.mouse_click_drag(305,92,340,92,"LEFT",1)             #对比度增强,向右拖拽
    sleep(1)
    autoit.mouse_click_drag(340,92,270,92,"LEFT",1)             #对比度增强,向左拖拽
    sleep(1)
    autoit.mouse_click("LEFT",245,92,1,10)                      #对比度增强,点击“-”1次
    sleep(1)
    autoit.mouse_click("LEFT",360,92,2,10)                      #对比度增强,点击“+”2次
    sleep(1)
    autoit.mouse_click("LEFT",220,92,1,10)                      #对比度增强,点击“对比度”恢复原状

    '''透明度增强'''
    autoit.mouse_click_drag(450,92,510,92,"LEFT",1)             #透明度增强,向右拖拽
    sleep(1)
    autoit.mouse_click_drag(510,92,480,92,"LEFT",1)             #透明度增强,向左拖拽
    sleep(1)
    autoit.mouse_click("LEFT",435,92,1,10)                      #透明度增强,点击“-”1次
    sleep(1)
    autoit.mouse_click("LEFT",555,92,2,10)                      #透明度增强,点击“+”2次
    sleep(1)
    autoit.mouse_click("LEFT",405,92,1,10)                      #透明度增强,点击“透明度”恢复原状

    '''拉伸方式'''

    autoit.mouse_click("LEFT",745,92,1,10)                      #点击拉伸方式,展开下拉列表
    sleep(1)
    autoit.send("{up 5}")                                       #切换到下拉列表第一位
    autoit.send("{enter}")                                      #确定选择
    sleep(1)         #1%线性拉伸

    autoit.mouse_click("LEFT",745,92,1,10)                      #点击拉伸方式,展开下拉列表
    sleep(1)
    autoit.send("{up 5}")                                       #切换到下拉列表第一位
    sleep(1)
    autoit.send("{down 1}")                                     #选择下拉列表第二位
    sleep(1)
    autoit.send("{enter}")                                      #确定选择
    sleep(1)         # 2%线性拉伸

    '''视图联动与拉伸方式类似'''
コード例 #21
0
ファイル: ccd_panel.py プロジェクト: h-jones/quinlab
 def open_xcap(self):
     xcap = "C:\\Program Files\\EPIX\\XCAP"
     xcap += "\\program\\xcapwxx.exe -Xmx128M -myjava"
     autoit.run(xcap, "C:\\Users\\Public\\Documents\\EPIX\\XCAP")
     autoit.win_wait_active("EPIX")
     autoit.send("{TAB}")
     sleep(0.05)
     autoit.send("{ENTER}")
     sleep(0.05)
     autoit.win_wait_active("View #")
     autoit.win_activate(self._gui_title)
コード例 #22
0
def log_in(user):
    os.system('taskkill /f /im Steam.exe')
    os.system('start "" "C:\Program Files (x86)\Steam\Steam.exe" -login {} {}'.format(
        batch_sanitized(user.get_username()),
        batch_sanitized(user.get_password())
    ))
    if user.get_shared_secret() is not None:
        autoit.win_wait("Steam Guard")
        autoit.win_activate("Steam Guard")
        autoit.win_wait_active("Steam Guard")
        autoit.send(generate_auth_code(user.get_shared_secret()))
        autoit.send('{ENTER}')
コード例 #23
0
def InformarLote(Qtd):
    time.sleep(Variaveis.TEnter)
    log.EscreverLog('Informar Lote')
    autoit.send("{CTRLDOWN}l{CTRLUP}")
    time.sleep(Variaveis.TDig)
    autoit.win_wait_active("[Class:TFRM_OBRIGAITENSLOTE]", Variaveis.TTelaL)
    time.sleep(Variaveis.TDig)
    time.sleep(Variaveis.TEnter)
    autoit.control_click("[Class:TFRM_OBRIGAITENSLOTE]", "TVSMColorButton1")
    time.sleep(Variaveis.TEnter)
    log.EscreverLog('Selecionar Lote')
    time.sleep(Variaveis.TDig)
    autoit.win_wait_active("[Class:TFRM_ITENSLOTE]", Variaveis.TTelaL)
    time.sleep(Variaveis.TDig)
    autoit.send(Qtd)
    time.sleep(Variaveis.TEnter)
    autoit.send("{ENTER}")
    time.sleep(Variaveis.TEnter)
    time.sleep(Variaveis.TDig)
    autoit.control_click("[Class:TFRM_ITENSLOTE]", "TVSMColorButton1")
    time.sleep(Variaveis.TEnter)
    time.sleep(Variaveis.TDig)
    autoit.send("{ENTER}")
    time.sleep(Variaveis.TEnter)
    time.sleep(Variaveis.TFinal)
コード例 #24
0
ファイル: login.py プロジェクト: bopopescu/DevsON
    def Crtx(self):
        log.EscreverLog('Função CRTX')
        log.EscreverLog('ESC')
        autoit.send("{ESC}")
        log.EscreverLog('Timer ' + str(Variaveis.TDig))
        time.sleep(Variaveis.TDig)

        log.EscreverLog('ESC')
        autoit.send("{ESC}")
        log.EscreverLog('Timer ' + str(Variaveis.TDig))
        time.sleep(Variaveis.TDig)

        log.EscreverLog('Limpa Tela')
        autoit.send("{CTRLDOWN}x{CTRLUP}")
        log.EscreverLog('Timer ' + str(Variaveis.TDig))
        time.sleep(Variaveis.TDig)
        try:
            log.EscreverLog('Tempo.do alerta sem Produto ' + 'Timer ' +
                            str(Variaveis.TTela))
            autoit.win_wait_active("[Class:TFRM_VSMTASKDIALOG]",
                                   Variaveis.TTela)
            log.EscreverLog('Botão Ok')

            autoit.control_click("[Class:TFRM_VSMTASKDIALOG]", "TRzBitBtn1")
            log.EscreverLog('Clicou Ok')
            log.EscreverLog('Timer ' + str(Variaveis.TDig))
            time.sleep(Variaveis.TDig)
        except:
            log.EscreverLog('Não teve Alerta, Limpando tela')

        log.EscreverLog('Enter')
        autoit.send("{ENTER}")
        log.EscreverLog('Timer ' + str(Variaveis.TEnterR))
        time.sleep(Variaveis.TEnter)
        log.EscreverLog('Sai Função CRTX')
コード例 #25
0
	def upload_project(self, projectname):
		"""上传工程"""
		w0 = WinControl(self.BECivilWin)
		if w0.exists():
			m1 = MouseControl()
			m1.click(self.BECivilWin, '', screen_point.系统[0], screen_point.系统[1])
			m1.click(self.BECivilWin, '', screen_point.上传工程[0], screen_point.上传工程[1])
			w1 = WinControl("打开")
			sleep(4)
			if w1.exists():
				w1.wait(3)
				w1.setState(3)
				# 输入保存上传工程的地址
				m1.click('打开', '', 820, 45)
				w1.controlSetText('[CLASS:Edit; INSTANCE:2]', self.uploadaddress)
				autoit.send("{ENTER}")
				sleep(2)
				w1.controlSetText('[CLASS:Edit; INSTANCE:1]', projectname)
				w1.controlClick('[CLASS:Button; INSTANCE:1]')
				sleep(2)
				w2 = WinControl("上传工程")
				sleep(2)
				if w2.exists():
					w2.wait(3)
					w2.controlClick('[CLASS:Button; INSTANCE:3]')
					sleep(3)
					w3 = WinControl("上传位置")
					if w3.exists():
						w3.wait(3)
						# 选择IM测试
						m1.click(self.BECivilWin, '', 940, 435)
						sleep(1)
						w3.controlClick("[CLASS:Button; INSTANCE:1]")
					else:
						raise Exception('未选中上传位置窗口')
					sleep(1)
					w2.controlClick('[CLASS:Button; INSTANCE:1]')
				else:
					raise Exception('未选中上传工程窗口')
			else:
				raise Exception('未选中打开窗口')
			sleep(22)
			w5 = WinControl("Luban Explorer(Civil)提醒您")
			w5.wait(60)
			if w5.exists():
				pass
			else:
				raise Exception("上传成功提示未显示")
		else:
			raise Exception("未识别BECivil窗口")
コード例 #26
0
    def test_search(self):
        # 运行网易云音乐
        autoit.run(self.cloudmusic_path)
        time.sleep(5)

        # 等待网易云音乐窗口激活
        autoit.win_wait_active(self.cloudmusic_title)

        # 按5下TAB切换至搜索框
        autoit.send("{TAB 5}")

        # 搜索歌曲
        autoit.send(self.song)
        time.sleep(1)

        # 按3下向下键选择第一首歌曲
        autoit.send("{DOWN 3}")
        time.sleep(1)

        # 按回车键播放歌曲
        autoit.send("{ENTER}")
        time.sleep(1)

        # 校验当前窗口标题是否含有搜索歌曲名
        title = autoit.win_get_title(self.cloudmusic_title)
        assert self.song in title, self.song.encode('utf-8') + ' not in ' + title.encode('utf-8')
コード例 #27
0
 def loadSettings(self, choice):
     self.bot.get("https://orteil.dashnet.org/cookieclicker/")
     time.sleep(5)
     self.bot.find_element_by_partial_link_text("Got it").click()
     time.sleep(1)
     if choice == "n":
         self.bot.find_element_by_id('prefsButton').click()
         time.sleep(1)
         self.bot.find_element_by_partial_link_text(
             "Load from file").click()
         time.sleep(1)
         autoit.win_wait_active("Otwieranie")
         autoit.send("D:\\projekty python\\cookie\\venv\\Include\\save.txt")
         autoit.send("{ENTER}")
コード例 #28
0
def DadosOrcamento():
    log.EscreverLog('Funçao Dados Orcamento')
    try:
        log.EscreverLog('Tela Orcamento')
        log.EscreverLog('Tempo. ' + str(Variaveis.TTela) + 'segundos')
        autoit.win_wait_active("[Class:TFRM_PERSONALCUPOM]", Variaveis.TTela)

        log.EscreverLog('Orcamento Ativo')
        Tecla.TempoR()
        autoit.control_send("[Class:TFRM_PERSONALCUPOM]", "TRzDBEdit7",
                            "Wellington de Pauda da Silva")
        log.EscreverLog('Inseriu Nome')

        Tecla.Enter()
        Tecla.TempoR()
        autoit.control_send("[Class:TFRM_PERSONALCUPOM]", "TRzDBEdit6",
                            "Rua Londrina 141")
        Tecla.Enter()
        Tecla.TempoR()
        autoit.control_send("[Class:TFRM_PERSONALCUPOM]", "TRzDBEdit2",
                            "Jardim Parana")
        Tecla.Enter()
        Tecla.TempoR()
        autoit.control_send("[Class:TFRM_PERSONALCUPOM]", "TRzDBEdit5",
                            "19807505")
        Tecla.Enter()
        Tecla.TempoR()
        log.EscreverLog("Cidade")
        autoit.send("A")
        autoit.win_wait_active("[Class:TFRM_LOCALIZAR]", Variaveis.TTela)
        Tecla.TempoR()
        autoit.send("SSIS")
        for x in range(0, 3):
            Tecla.Enter()

        autoit.control_send("[Class:TFRM_PERSONALCUPOM]",
                            "TVSMDBEditTelefone1", "1897590628")
        for x in range(0, 2):
            Tecla.Enter()
        autoit.control_send("[Class:TFRM_PERSONALCUPOM]", "TRzDBEdit4",
                            "39177789806")
        Tecla.Enter()
        autoit.control_send("[Class:TFRM_PERSONALCUPOM]", "TRzDBEdit3",
                            "473493895")

        Tecla.F10()
    except:
        log.EscreverLog('Nao chamou a tela orcamento')
    log.EscreverLog("Sai Funçao Dados Orcamento")
コード例 #29
0
 def delete_value(self, target):
     """
     将找到的文本框内容删除
     :param target: 目标元素
     :return: 已赋值的对象
     """
     try:
         target.Click()
         # 全选文本框内内容,并删除
         autoit.send("^a" + "{DELETE}")
         time.sleep(.6)
     except Exception as e:
         log.warning("【%s】内容删除失败,请处理!" % (target.Name))
         log.warning("原因:", e)
     return target
コード例 #30
0
	def add_form(self, y1=515, message='封面'):
		"""添加表单用"""
		w0 = WinControl("添加表单")
		if w0.exists():
			w0.wait(3)
			m1 = MouseControl()
			m1.click('添加表单', '', 990, 495)
			sleep(1)
			m1.click('添加表单', '', 990, y1)
			sleep(0.5)
			m1.click('添加表单', '', 990, 530)
			autoit.send(message)
			sleep(0.5)
			w0.controlClick("[CLASS:Button; INSTANCE:1]")
		else:
			raise Exception('添加表单未成功')
コード例 #31
0
def Entrega():
    log.EscreverLog('Função Dados de entrega')
    log.EscreverLog("Alt e")
    autoit.send("{ALTDOWN}e{ALTUP}")
    log.EscreverLog('Timer ' + str(Variaveis.TDig))
    time.sleep(Variaveis.TDig)


    log.EscreverLog("Tempo.tela de Dados Entrega")
    log.EscreverLog('Timer ' + str(Variaveis.TTela))
    autoit.win_wait_active("[Class:TFRM_DADOSENTREGA]", Variaveis.TTela)

    autoit.control_click("[Class:TFRM_DADOSENTREGA]", "TRzDBNumericEdit4")
    log.EscreverLog('Timer ' + str(Variaveis.TEnter))
    time.sleep(Variaveis.TEnter)
    log.EscreverLog('Sai Função Dados de entrega')
コード例 #32
0
def F8LancamentoVenda():
    log.EscreverLog('Função chama Final Venda(F8LancamentoVenda)')
    Tempo.F8TelaLancamento()
    log.EscreverLog('F8')
    autoit.send("{F8}")
    Tempo.DigProd()
    if Variaveis.DocFiscal == "NFCE":
        Tela.AlertaTelaVenda('Alerta Nfce em Homologação',
                             'Não teve Alerta NFCE')
    log.EscreverLog('Sai Função F8')
    if Variaveis.DocFiscal == "NFE":
        Tela.AlertaTelaVenda('Alerta NFE em Homologação',
                             'Não teve Alerta NFE')
    Tela.FinalVenda()
    log.EscreverLog('Sai Função F8')
    Tempo.TelaFinalVenda()
コード例 #33
0
def main():
    data = request.data.decode('UTF-8')

    json_data = json.loads(data) # get the json from the client

    # loop five times to check all the weapon slots to detect a change
    for i in range(0,5):
        try:
            weapon_clip = json_data['player']['weapons']['weapon_'+str(i)]['ammo_clip']
            previous_weapon_clip = json_data['previously']['player']['weapons']['weapon_'+str(i)]['ammo_clip']
            if weapon_clip < previous_weapon_clip: #if the weapon was fired
                print('Shot detected!')
                autoit.win_activate('Counter-Strike: Global Offensive') # prepare by forcing us to focus on CS:GO (so the keybinds trigger)
                autoit.send(HOTKEY_AUTOIT) # send hotkey
        except:
            pass

    return 'hello world'
コード例 #34
0
ファイル: scrapePK.py プロジェクト: brndnheal/SENG474
			'''
			team= browser.find_element_by_xpath("//div[@id='onload.4']/div/div[1]")
			team.click()
			team= browser.find_element_by_xpath("//div[@id='onload.4']/div/div[2]/div/div[text()='"+game[team_type]+"']")
			team.click()
			wait = WebDriverWait(browser, 100).until(EC.presence_of_element_located((By.ID, 'gametable')))
		
			time.sleep(2)
			wait = WebDriverWait(browser, 100).until(EC.presence_of_element_located((By.ID, 'downloadSData')))

			wait = WebDriverWait(browser, 100).until(EC.element_to_be_clickable((By.ID,'downloadSData')))
			button = browser.find_element_by_id("downloadSData")
			button.click()
			#AutoIT to handle the dialog window
			autoit.win_wait_active("[CLASS:MozillaDialogClass]", 10)
			autoit.send("{ALTDOWN}s{ALTUP}")
			time.sleep(1)
			autoit.send("{ENTER}")
			time.sleep(1)
		finally:
			print "Closing Browser"
			browser.close()
			#Now Move the file to a good folder
			if(team_type =="hometeam"):
				letter="A" 
			else: 
				letter="B"


			new_dir="C:\Users\Brendan\Documents\SENG474\DataCollection\Data\PenaltyKill\\" + formatDateB(game["date"])
			new_file=new_dir+"\\" + formatDateB(game["date"])+"-"+game["gamenumber"]+"-"+game["hometeam"]+"-"+game["awayteam"]+"-["+game["winner"]+"]-"+letter+".csv"
コード例 #35
0
def main():

    user_dir = get_users_main_directory()
    check_lp_power_data_folder_exists(user_dir)
    check_database_file_exists(user_dir)
    trial = {}
    trial = prompt_setup(trial, user_dir)

    # stopgap for pre-class variables
    walk_speed = trial["Speed [MPH]"]
    walk_style = trial["Walk Style [Normal/LP]"]
    pack_number = trial["Pack Number [XXX]"]

    # MAKE FOLDERS FOR TRIAL BASED ON PREVIOUSLY-ENTERED INPUTS
    make_pack_folder(pack_number, walk_speed, walk_style, user_dir)

    print('.....')
    print("..........Launching.....")

    # SET UP BASIC AUTO-IT SETTINGS TO USE WINDOW-RELATIVE COORDINATES
    autoit.auto_it_set_option('MouseCoordMode', 0)
    autoit.auto_it_set_option('SendKeyDelay', 10)

    # OPEN PICOSCOPE USING OUR DEFAULT WINDOW LAYOUT WITH TWO PANELS AND POWER UP TOP
    default_pico = os.path.join(user_dir, "electrical_power.psdata")
    click_on_file(default_pico)

    # PREPARE TO RUN THE RECORD DATA MACRO
    autoit.win_wait('PicoScope 6 - [electrical_power.psdata]')
    autoit.win_activate('PicoScope 6 - [electrical_power.psdata]')
    time.sleep(0.5)
    autoit.send('{ALT}{TAB}{TAB}{TAB}{TAB}{ENTER}{END}{UP}{ENTER}')
    autoit.win_wait('Macro Recorder')
    autoit.control_click('Macro Recorder', "[Name:_buttonImport]")
    time.sleep(1)
    macro_text = os.path.abspath(os.path.join(user_dir, "record_20sec.psmacro"))
    autoit.clip_put(macro_text)
    autoit.win_wait("Open")
    autoit.send('^V', 0)
    autoit.send('{ENTER}')
    msgbox("Ready to go?")

    # RUN THE MACRO
    autoit.win_activate('Macro Recorder')
    autoit.win_wait('Macro Recorder')
    autoit.control_click('Macro Recorder', "[Name:_buttonExecute]")
    time.sleep(22)
    autoit.win_activate('Macro Recorder')
    autoit.send('{ESCAPE}')

    # BEGIN SAVING THE DATA
    i = datetime.now()
    save_text = os.path.abspath(os.path.join(user_dir, 'LP Power Data', "{}".format("LP-{0}".format(pack_number)), "{0}MPH-{1} Walk".format(walk_speed, walk_style),
                             "{0}MPH-{1} Walk_".format(walk_speed, walk_style) + i.strftime('%Y-%m-%d %Hh%Mm%Ss')+ ".psdata"))
    autoit.clip_put(save_text)

    # SAVE ALL CAPTURED WAVEFORMS IN PICO FORMAT
    autoit.win_activate('PicoScope 6')
    autoit.win_wait("PicoScope 6")
    autoit.send('{ALT}{f}{a}')
    time.sleep(.5)
    autoit.win_wait("Save As")
    autoit.control_send('Save As', "[Class:Edit;INSTANCE:1]", '^V', 0)
    autoit.send('{ENTER}')

    # BEGIN SAVE SEQUENCE FOR CSV FORMAT
    autoit.win_activate('PicoScope 6')
    autoit.win_wait("PicoScope 6")
    autoit.mouse_click("primary", 433, 67, 2, 1)
    # MUST CLICK ON SECTION OF WINDOW CONTAINING POWER TRACE OR ALL AVERAGES CALCULATED WILL BE MESSED UP
    autoit.win_activate('PicoScope 6')
    autoit.win_wait("PicoScope 6")
    autoit.mouse_click("primary", 230, 260, 1, 0)
    # autoit.control_click('PicoScope 6', "[CLASS:WindowsForms10.Window.8.app.0.1114f81_r13_ad1; INSTANCE:55]")
    autoit.send('{ALT}{f}{a}')
    time.sleep(.5)
    autoit.win_wait("Save As")
    autoit.control_send('Save As', "[Class:Edit;INSTANCE:1]", '^V', 0)

    # SAVE ALL CAPTURED 5SEC INTERVALS
    autoit.control_click('Save As', "[CLASS:ComboBox;INSTANCE:3]")
    autoit.send("{HOME}{DOWN}{DOWN}{ENTER}")
    # autoit.control_click("Save As", "[NAME:_currentBufferRadio]")
    time.sleep(0.5)
    autoit.send('{ENTER}')
    time.sleep(4.5)
    autoit.process_close('PicoScope.exe')
    # BOTH SAVE OPERATIONS NOW COMPLETE. THERE IS A CSV FOR EACH 5SEC INTERVAL IN A NEW SUBDIRECTORY OF THIS TRIAL.

    print("")
    print("Sit tight, I'm still doing some thinking....")

    # UPDATE ALL CSV FILES TO BE XLSX AND CALCULATE THEIR 5SEC AVERAGES
    run_avgs = recursively_repair_all_csv_files(save_text, user_dir, walk_speed)

    # ADD ALL INFORMATION COLLECTED TO THE EXPERIMENTS SPREADSHEET
    patch_experiments_database(trial, run_avgs, user_dir)
    print("")

    # WRITE THE METADATA SETTINGS TO A FILE FOR FUTURE RECORD
    with open('{}'.format(save_text.replace(".psdata", ".LPmeta")), 'w') as outfile:
        json.dump(trial, outfile, indent=4, separators=(',', ': '))
    print("")
    print("LP Metadata file successfully saved for the future with all info the state of the pack as you have just tested it.")

    print("")
    # print_average_power(dest_filename)
    print(".................................. Testing Complete.")
コード例 #36
0
ファイル: Windows10.py プロジェクト: aaronrubin901/sanity
 def _open_connect_bar(self):
     autoit.send("#k")
     time.sleep(3)
コード例 #37
0
 def _open_project_bar(self):
     autoit.send("#p")
     time.sleep(3)
コード例 #38
0
 def _go_to_desktop(self):
     autoit.send("#d")
     time.sleep(3)
コード例 #39
0
 def click_enter(self):
     autoit.send("{ENTER}")
     time.sleep(1)