Reputation: 315
In my appium-code, on using swipe, scroll methods and executing the code. Getting the below exception.
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. (WARNING: The server did not provide any stacktrace information)
And I don't see the SendKeyEvent
method in the auto suggest dropdown. When I am manually typing SendKeyEvent(), it's throwing an error as undefined in the type AndroidDriver.
Can anyone let me know please ?
Upvotes: 1
Views: 6798
Reputation: 1
This code worked for me:
AndroidDriver driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), cap);
driver.pressKeyCode(AndroidKeyCode.HOME);
What is supported? What is obsolete? How to find answer to these questions? Can someone please direct to reference???
Upvotes: -2
Reputation: 59
If you use java client 3.2.0 then you should try using pressKeyCode(keyCode) method instead of sendKeyEvent(keyEvent). Hope it helps.
Upvotes: 4
Reputation: 595
Of course, because this method is not for the driver. You can send keys to the element, not the driver. The solution would be following:
WebElement element = driver.findElement(By.id("the_id"));
element.sendKeys("necessary_text");
Upvotes: 0