// 获取到toast信息 // toast只能够根据它的文本值来定位到 WebElement toastElement = androidDriver.findElementByXPath("//*[contains(@text,'登录成功')]"); //toast元素是不能够点击,提示用户信息 System.out.println(toastElement.getText());