Appium获取textInput值不起作用

时间:2017-10-20 05:12:56

标签: react-native appium

运行一个react-native项目,我想使用accessibilityId访问输入字段的值,但是从react native 44升级到native 49后

element.getAttribute("value");似乎不起作用。

跑步:

node: 8.5.0

react-native: 0.49.0

appium: 1.7.0

1 个答案:

答案 0 :(得分:0)

我已经将我的工作代码粘贴了它的Java appium代码,希望对您有用。

String errorC = driver.findElement(By.xpath("//android.widget.EditText[@content-desc=\"testPassword\"]")).getText();
System.out.println(errorC);