解决appium+puthon 进行公众号测试时,找不到:com.tencent.mm:id/f8y的问题和 __init__() takes 2 positional arguments but 3 were given 的问题
之前一直用driver.find_element_by_id("com.tencent.mm:id/f8y") 查找元素,总是报错找不到该元素。
原来是因为 需要时间,所以后来改为了:
wait=WebDriverWait(driver, 10)
el1 = wait.until(EC.presence_of_element_located(By.ID, 'com.tencent.mm:id/f8y'))
以后又报错: __init__() takes 2 positional arguments but 3 were given
原来是因为EC.presence_of_element_located 需要数组所以改为:
el1 = wait.until(EC.presence_of_element_located((By.ID, 'com.tencent.mm:id/f8y')))
终于好了~