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