我需要将文本发送到带有提示文本的文本字段。
我尝试过的代码
var button = $("#button");
button.click();
var input = $("#input");
input.sendKeys("hello");
但是它返回我的sendKeys不是一个函数。我可以知道对此有什么解决方案吗?预先感谢。
根据Java的appium official documentation,您可以在webdriver.io中使用addValue
功能,而在webdriver中使用type
。请看下面的代码片段。
// webdriver.io example
$("~SomeAccessibilityId").addValue("Enter");
// wd example
let element = await driver.elementByAccessibilityId("SomeAccessibilityID");
await element.type("Hello world!")