SendKeys in appium/appium clear the text input field when the field loses focus?

SendKeys in appium/appium clear the text input field when the field loses focus?

Hello,

The issue user reported is due to onChangeEvent not getting fired after the text is entered via Appium in First Name and Last Name field using sendKeys()

This is mostly due to misconfiguration in the front-end application.

The workaround to fire this event is to send a javascript command for both fields.

Please check the script attached: LambdaTest Sharing

This issue is logged with Appium and the solution is not yet available.

SendKeys clears text input field when the field loses focus · Issue #10883 · appium/appium

Type/Sendkeys issue on iOS Devices · Issue #9988 · appium/appium

1 driver.find_element(By.NAME, "first_name").send_keys("LT ")

2 sleep(2)

3 driver.execute_script("arguments[0].dispatchEvent(new Event('change'));", driver.find_element(By.NAME, "first_name"))

4 sleep(2)

5 driver.find_element(By.NAME, "last_name").click()

6 sleep(2)

7 driver.find_element(By.NAME, "last_name").send_keys("Test ")

8 sleep(2)

9 driver.execute_script("arguments[0].dispatchEvent(new Event('change'));", driver.find_element(By.NAME, "last_name"))

10 sleep(2)