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)
Ejemplo n.º 2
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')
Ejemplo n.º 3
0
expect(text).to(contain("3*10=30"))

# open menu
autoit.send("!a")

sleep(2)
autoit.send("{DOWN 3}")
autoit.send("{ENTER}")

autoit.win_wait_active(title=title_save)
autoit.control_set_text(title=title_save,
                        control="[CLASS:Edit; INSTANCE:1]",
                        control_text=new_file)

autoit.control_click(title_save, "[CLASS:Button; INSTANCE:1]")
sleep(3)

try:
    autoit.control_focus(confirm, "[CLASS:Button; INSTANCE:1]")
    autoit.control_click(confirm, "[CLASS:Button; INSTANCE:1]")
except:
    print("Tela de confirmar não encontrada!")

sleep(3)
autoit.win_wait_active(title=new_title)
result = autoit.win_get_title(title=new_title)
print(result)
expect(result).to(contain(new_title))
autoit.win_close(title=new_title)
Ejemplo n.º 4
0
import autoit
import time

putty = r'C:\Program Files (x86)\PuTTY\putty.exe'
host_ip = '10.171.59.99'
host_port = '22'
username = '******'
password = '******'

autoit.run(putty)
time.sleep(2)
autoit.win_activate("PuTTY Configuration")
autoit.send("{DEL}"*15)
autoit.send(host_ip,1)
autoit.send('{TAB}')
autoit.send('{DEL}'*5)
autoit.send(host_port)

time.sleep(2)
autoit.control_click("PuTTY Configuration","&Open")
time.sleep(2)
title = autoit.win_get_title(host_ip)
print('title: %s' % title)

autoit.win_activate(title)
autoit.send(username + '{ENTER}')
time.sleep(5)
autoit.send(password + '{ENTER}')
autoit.send('{ENTER}'*2)
import autoit
import time

#NIU-RSA-PC1 - RSA SecurID Token /  RSA SecurID Token - the two titles my app has
# I believe the second one is what i need

rsa_path = "C:\\Program Files\\RSA SecurID Software Token\\SecurID.exe"
nc_path = "C:\\Program Files (x86)\\Juniper Networks\\Network Connect 7.4.0\\dsNetworkConnect.exe"

autoit.run(rsa_path)

active = autoit.win_wait_active(
    "NIU-RSA-PC1 - RSA SecurID Token",
    10)  # perfect, waits until second, real window opens and acts immediately!
title = autoit.win_get_title("[CLASS:QWidget]")
prccessid = autoit.win_get_process("NIU-RSA-PC1 - RSA SecurID Token")

time.sleep(0.5)

RSA_Text = autoit.win_get_text("[CLASS:QWidget]")

#autoit.control_send("NIU-RSA-PC1 - RSA SecurID Token", 'edit', "dodo")

# text = autoit.win_get_text("NIU-RSA-PC1 - RSA SecurID Token")

print(active, title, prccessid, RSA_Text)

autoit.win_close("NIU-RSA-PC1 - RSA SecurID Token")

# autoit.control_send("[CLASS:Notepad]", "Edit1", "hello world{!}")
# autoit.win_close("[CLASS:Notepad]")