Question

I use Windows Phone and a RemoteWebDriver but when I try to use a "SendKeys" method, I got this error :

Unexpected error. Call could not be fullfield. JavaScript injection failed.

Example :

driver.FindElement(By.Id("ID")).SendKeys("string");

Best regards,

Xialuna

Was it helpful?

Solution

So, I found a solution.

I create a new function like this :

public void javascriptSendKeys(String id, String value)
{
    String script = "document.getElementById(\"" + id + "\").value=\"" + value + "\" ";
    ((IJavaScriptExecutor)driver).ExecuteScript(script);
}

And I use it when I need to use a SendKeys method.

It's work fine for me.

Have a nice day !

Xialuna

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top