(d, xpath_str, timeout)
| 53 | |
| 54 | # 通过xpath超时寻找,找到返回true,找不到返回false |
| 55 | def find_timeout_xpath(d, xpath_str, timeout): |
| 56 | flag = False |
| 57 | for i in range(timeout): |
| 58 | if not d.xpath_exists(xpath_str): |
| 59 | time.sleep(0.8) |
| 60 | continue |
| 61 | flag = True |
| 62 | break |
| 63 | return flag |
| 64 | |
| 65 | |
| 66 | # 通过正则寻找,找到返回[result],找不到返回[] |
no test coverage detected