1
我目前正在嘗試自動化登錄流。幸福路徑的編碼正常工作。我現在正在編碼無效憑證。Appium:找不到可見的元素
我的代碼看起來與此類似:
driver.findElement(By.xpath("//android.widget.Button[@text='Password']").click;
//At this point the button is pressed
Thread.sleep(10000); //Screen with the following item is definitely visible
MobileElement actual = (MobileElement)(new WebDriverWait(driver, 30).until(ExpectedConditions.presenceOfElementLocated(By.xpath("//android.view.View[@content-desc='Invalid user ID or password. Try again']"))));
//Note when I print out the xml and use xpathfinder I get 1 response
我得到這樣的響應:
Am element could not be located on the page using the given search parameters. (WARNING: The server did not provide any stacktrace information)
感謝您的評論,我一定會嘗試在不同的測試案例。當我使用'getAttribute(「content-desc」)'時發現這是一個問題。只要我將屬性更改爲名稱就行了。當檢查員告訴我使用「content-desc」時,我很奇怪, – JaysonP