看 STF 的 Changelog 里有一条
Fixed ZUK Z1, Z2 and others by adding an alternate install location for our binaries, since /data/local/tmp is mounted as noexec on those devices. Thanks @dkw72n!
不过还在 HEAD 里没有发布,楼主可以拉取最新代码本地编译运行 STF 试试
我前段时间也在做 Selenium 自动化测试,对于这类问题的解决方法是使用 WebDriverWait。常用下面几种:
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as ec
# sec为等待时间
try:
WebDriverWait(browser, sec).until(
# 等待XPATH元素可见
ec.visibility_of_element_located((By.XPATH, xpath))
# 等待XPATH元素不可见
ec.invisibility_of_element_located((By.XPATH, xpath))
# 等待XPATH元素展现
ec.presence_of_element_located((By.XPATH, xpath))
# 等待标题为title
ec.title_is(title)
)
except Exception as e:
logging.warning(e)
sys.exit(-1)