org.openqa.selenium.WebDriverException: unknown error (An unknown server-side error occurred

HI,

When I am trying to enter a password in the password field using sendkeys() method. I am getting this error “org.openqa.selenium.WebDriverException: unknown error (An unknown server-side error occurred. status=‘false’. Failed to complete internal method: ‘elementSendText args: [NATIVE, xpath=(//[contains(@resource-id,‘password2’)])[1], 0, 1234]’, details: Failed to send text to 'xpath=(//[contains(@resource-id,‘password2’)])[1]’. ) (WARNING: The server did not provide any stacktrace information)”

@FindBy(xpath="//*[contains(@resource-id,‘password1’)]")
AndroidElement TypePassword;

@FindBy(xpath="//*[contains(@resource-id,'password2')]")
WebElement RepeatPassword;

public void EnterPassword() {
    TypePassword.click();
	TypePassword.sendKeys("1234");
	RepeatPassword.sendKeys("1234");

It would be great if you have any workaround for this.

Hi @praveenk,

Is there any reason for using AndroidElement on the first element, and WebElement on the second element?

According to the error message it fails on //[contains(@resource-id,‘password2’)])[1], was typePassword element successful with entering some value ?

No there is no reason… even in the password 1 i got the same error…

If you could help me, it would be great

Same error for Password1:

org.openqa.selenium.WebDriverException: unknown error (An unknown server-side error occurred. status=‘false’. Failed to complete internal method: ‘elementSendText args: [NATIVE, xpath=(//[contains(@id,‘password1’)])[1], 0, 1234]’, details: Failed to send text to 'xpath=(//[contains(@id,‘password1’)])[1]’. ) (WARNING: The server did not provide any stacktrace information)

Several things to check:

  1. Is your AppiumDriver set to “instrumented” or “non-instrumented” mode ?? From the “screenshot” above it looks as if you app is not instrumented. Make sure to set the driver context to non-instrumented as well.

2)your FindBy looks odd to me…I am assuming that the value for attribute @resource-id will not be ‘password1’ based on the screenshot. That is the value for attribute @id, not the @resource-id field.

Let us know what you find.

Hey wakeIt,

  1. I have set my dirver to non-instrumented mode.
  2. I tried different xpath… It dint work with the xpath:

: @FindBy(xpath="//*[contains(@id,‘password1’)]")
AndroidElement TypePassword;

@FindBy(xpath="//*[contains(@id,'password2')]")
AndroidElement RepeatPassword;

If your app is an android native app (as opposed to hybrid)…

Personally, I don’t use the FindBy annotation, I use the driver.findElement flavor. From what I can see, the syntax you need is more like:

@AndroidFindBy(id = "password2’) //much simpler than provide XPATH

or

@AndroidFindBy(xpath="//*[contains(@id,‘password2’)]")

its not working… Same error

perhaps you can paste the driver creation code you are using ??

Also, are you sure you don’t have multiple of the same id’s on that page ? For example do you have multiple id = password1 ?? I realize you shouldn’t, but you can use the object spy to check.
Can you code manipulate any elements on the page ??

Somehow, Appium Studio is confused by by what’s its receiving from your code.