TA的每日心情 | 擦汗 前天 09:07 |
---|
签到天数: 527 天 连续签到: 4 天 [LV.9]测试副司令
|
1测试积点
求解(哪里不对),我写的这段代码执行起来,机器没有反应,但是代码也没任何报错,直接执行完了(Process finished with exit code 0)
- # encoding: utf-8
- from uiautomator import Device
- import os
- import time
- d = Device('66b0140')
- loop = 0
- class SwitchMode(object):
- def __init__(self, mode1, mode2, times):
- self.mode1 = mode1
- self.mode2 = mode2
- self.times = int(times)
- def test(self):
- for loop in range(self.times):
- d(text=self.mode1).click.wait()
- d(text=self.mode2).click()
- time.sleep(3)
- loop += 1
- print "switch to %s for %s times" % (self.mode2, loop)
- if __name__ == '__main__':
- SwitchMode('AUTO', 'PORTRAIT', 10)
复制代码
|
|