setText 不适用于 appium v​​ 1.5.2

setText dont work with appiun v 1.5.2

我正在为我的 android 应用程序编写测试,我有一个文本字段,我必须在其中输入内容,为此我编写了以下代码:

 $els = $this->element($this->using('class name')->value('android.widget.EditText'));
        $els->click();
        $els->setText("govin");

但是当我 运行 这个测试时我有这个错误:

 Something unexpected happened: 'Parameters were incorrect. We wanted {"required":["value"]} and you sent ["elementId","value"]

我发现 "setText" 在 appium v​​1.5.2 中不起作用

有人对此有替代方案吗?

谢谢

我不确定这是否适用于 php,我刚开始在 java windows 上学习 appium 但您可以尝试 sendKeys("string");

或尝试查看此内容 https://gist.github.com/aczietlow/7c4834f79a7afd920d8f

如果您使用的是 appium v​​1.5.2,"setText" 不受支持,您可以使用 "value" 函数