Does Send Key use keyboard events on IOS ?
See original GitHub issueQuestion
I have been through your documentation and stack overflow multiple times, but I am confused whether sendKeys function actually sends a Keyboard event through the IOS keyboard or does it simply copy the text sent by the appium-server to that text box?
For our automation we would like the keys to be keyboard events and not a simple copy paste.
Environment
- Appium version (or git revision) that exhibits the issue: v1.22.0
- Last Appium version that did not exhibit the issue (if applicable):
- Desktop OS/version used to run Appium: v1.22.0
- Node.js version (unless using Appium.app|exe):
- Npm or Yarn package manager:
- Mobile platform/version under test: IOS 15.2
- Real device or emulator/simulator: Both
- Appium CLI or Appium.app|exe: .app
Details
We have previously tried clicking on the key(using X and Y coords) once the keyboard becomes visible but that does not suite our use case
Code To Reproduce Issue
# iOS environment
import unittest
import time
from appium import webdriver
from appium.webdriver.common.appiumby import AppiumBy
desired_caps = dict(
platformName='iOS',
platformVersion='15.2',
automationName='xcuitest',
deviceName='iPhone 11 Pro'
# app='<location to the app>'
)
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
el = driver.find_element(by=AppiumBy.ACCESSIBILITY_ID, value='Settings').click()
el = driver.find_element(by=AppiumBy.ACCESSIBILITY_ID, value='Sign in to your iPhone').click()
driver.find_element(by=AppiumBy.ACCESSIBILITY_ID, value='username-field').send_keys('Hi therellll')
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (4 by maintainers)
Top Results From Across the Web
Handling key presses made on a physical keyboard
In iOS apps and Mac apps built with Mac Catalyst, the system reports key presses that a user makes on a physical keyboard...
Read more >Handling keyUp and keyDown events on iOS 13.4 and later
The first thing that we'll need to do in order to make that happen is to override three methods that'll let us handle...
Read more >ios - Programmatically Simulate Keyboard Events on the iPhone
I was wondering if it would be possible to simulate keyboard events - like key down and key up characters - and ...
Read more >Element: keydown event - Web APIs | MDN
The keydown and keyup events provide a code indicating which key is pressed, while keypress indicates which character was entered. For example, ...
Read more >[iOS] SendKeys to custom keyboard - Support - Appium Discuss
Hi,. Our application has a custom keyboard used to set text in specific fields. On Android, there is no problem in using sendKeys...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It seems like https://github.com/appium/appium-xcuitest-driver#mobile-performiohidevent might be the closest alternative. In general XCTest is pretty limited about their public APIs
This is internal Apple stuff. Simply follow the documented suggestion to retrieve possible values: