SMH
SMH

Reputation: 1

sendKeys is not a function Appium javascript Android

I need to send a text into a textfield with hint text.

The code i tried

var button = $("#button");
button.click();
var input = $("#input");
input.sendKeys("hello");

However it return me sendKeys is not a function. May i know is there any solutions for this? Thanks in advance.

Upvotes: 0

Views: 1468

Answers (2)

AlirezaAzizi
AlirezaAzizi

Reputation: 73

try this:

input.click();
driver.adbSendText("Type Something")

Upvotes: 0

Muzzamil
Muzzamil

Reputation: 2881

As per appium official documentation for Javascript, you can use addValue function in webdriver.io and type in webdriver. Please have a look on below code snippet.

// webdriver.io example
$("~SomeAccessibilityId").addValue("Enter");

// wd example
let element = await driver.elementByAccessibilityId("SomeAccessibilityID");
await element.type("Hello world!")

Upvotes: 1

Related Questions