更新时间:2023-02-14 15:07:36
特定活动意味着正在显示某些特定元素.我使用以下代码等待屏幕上的某些元素:
Specific activity means some specific element is being displayed. I use the following code to wait until some certain element on the screen:
WebDriverWait wait = new WebDriverWait(driver, 30);
wait.until(ExpectedConditions.elementToBeClickable(By
.xpath("//android.widget.Button[contains(@text, 'Log In')]")));
或:
WebDriverWait wait = new WebDriverWait(driver, 30);
wait.until(ExpectedConditions.presenceOfElementLocated(By
.xpath("//android.widget.TextView[contains(@resource-id, 'action_bar_title')]")));