question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fix for driver.getKeyboard().sendKeys() with the W3C protocol

See original GitHub issue

It is my understanding that, since the switch from JSONWP to the W3C protocol, the syntax driver.getKeyboard().sendKeys() is not supported anymore, the reason being that the underlying command is not present in the W3C specification. Can somebody please help answer these two questions:

  • What is the recommended way to accomplish the same functionality with the latest version of Appium?
  • Should the driver.getKeyboard().sendKeys() API be removed from all language bindings? My stance on this is that we should get the driver.getKeyboard().sendKeys() syntax working again through a workaround implemented in either language bindings or Appium code, but I am not familiar with the Appium internals and I might be wrong.

Any qualified opinion and advice on this issue is highly appreciated.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
adrianthcommented, Dec 17, 2018

@Warren25 This works if you can come up with a locator for the element. However, in cases where you can’t (e.g. some type of dynamically composed UI), you can’t get a reference to the element. However, if you can somehow figure out the coordinates of the element relative to some other element that you are able to locate, then you can tap the element to bring it in focus. This is where the driver.getKeyboard().sendKeys() would have been useful, if it worked, so you can type in the curently focused element.

I didn’t get to try the method suggested by @mykola-mokhnach, but it sounds like it should work. It’s weird that driver.switchTo().activeElement() returns a WebElement and not a MobileElement, but that’s hopefully not a problem.

0reactions
lock[bot]commented, Dec 17, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

webdriverio/webdriverio - Gitter
It's not working, due to keyboard enabled here- i faced same issue in appium/java also and resolve using this- driver.getKeyboard().sendKeys("jschwartz") ...
Read more >
Solution for sendkeys(CharSequence) in Selenium
If SendKeys is not working in Selenium webdriver or any error related to sendKeys (CharSequence) from the type Webelement then it will help....
Read more >
Send Keys - Appium
Description. Any UTF-8 character may be specified, however, if the server does not support native key events, it should simulate key strokes for...
Read more >
How to resolve this error Element not interactable Any solution
findElement(By.xpath("//span[contains(text(),'SeleniumHQ Browser ... ProtocolHandshake createSession INFO: Detected dialect: W3C Exception ...
Read more >
What's New in Appium Java Client 8.0.0 - Applitools
WebDriver Protocol Compliance. With Appium 2.0, we on the Appium team are making sure we are strictly W3C compliant. · Driver-Specific Options ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found