Appium 如何获取 textView 中的文本

韩家公子 · January 14, 2015 · Last by 韩家公子 replied at January 14, 2015 · 2063 hits

.elementByXPath("...").text('text', function(err, text){
console.log("text = "+text);
}).

js 的代码是这样写的么?

如果直接 var t = driver..elementByXPath("...").text();
t 是一个 [object promise],不是一个字符串

共收到 1 条回复 时间 点赞

应该这么写
.elementByXPath("...", function(err, el){
el.text(function(err, text) {
console.log(text);
});
})

需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up