我定义了这样一个方法,不知道为什么只滑动一次就卡在那里 ,要是把查找 button 的方法去掉,单独循环的话就可以。不知道哪里错了,烦请各位帮忙看看,谢谢
def enterconnect(cls):
time.sleep(5)
width = cls.driver.get_window_size()['width']
height = cls.driver.get_window_size()['height']
for i in range(0, 4):
try:
cls.driver.swipe(width * 6 / 7, height / 2, width / 7, height / 2, 1000)
cls.driver.implicitly_wait(1000)
clickbutton = cls.driver.find_elements_by_id('com.snda.wifilocating:id/btn_startuse')
if len(clickbutton) > 0:
clickbutton.click()
except:
traceback.format_exc()