An error occurred while executing user supplied JavaScript
<p>I am getting this error while testing appium for ios : </p>

<blockquote>
<pre><code>&gt; Exception in thread "main" org.openqa.selenium.WebDriverException: An
&gt; error occurred while executing user supplied JavaScript. (WARNING: The
&gt; server did not provide any stacktrace information) Command duration or
&gt; timeout: 5.15 seconds Build info: version: '2.52.0', revision:
&gt; '4c2593c', time: '2016-02-11 19:03:33' System info: host:
&gt; 'users-iMac.local', ip: '192.168.1.16', os.name: 'Mac OS X', os.arch:
&gt; 'x86_64', os.version: '10.10.5', java.version: '1.7.0_80' Session ID:
&gt; cdcaf9fa-3530-4b09-8bca-c30c42d6c29e Driver info:
&gt; io.appium.java_client.ios.IOSDriver Capabilities
&gt; [{platformVersion=9.2, platform=MAC, databaseEnabled=false,
&gt; javascriptEnabled=true, platformName=iOS, deviceName=iPad 2,
&gt; browserName=iOS, webStorageEnabled=false,
&gt; bundleId=com.InovaSquad.Artinove, networkConnectionEnabled=false,
&gt; desired={platformVersion=9.2, deviceName=iPad 2, platformName=iOS,
&gt; bundleId=com.InovaSquad.Artinove}, locationContextEnabled=false,
&gt; warnings={}, takesScreenshot=true}] at
&gt; sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
&gt; at
&gt; sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
&gt; at
&gt; sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
&gt; at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at
&gt; org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
&gt; at
&gt; org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
&gt; at
&gt; org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
&gt; at
&gt; io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
&gt; at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1) at
&gt; io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1) at
&gt; org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:327)
&gt; at
&gt; io.appium.java_client.DefaultGenericMobileElement.execute(DefaultGenericMobileElement.java:44)
&gt; at io.appium.java_client.MobileElement.execute(MobileElement.java:1)
&gt; at io.appium.java_client.ios.IOSElement.execute(IOSElement.java:1) at
&gt; org.openqa.selenium.remote.RemoteWebElement.sendKeys(RemoteWebElement.java:122)
&gt; at test1.FirstTest.main(FirstTest.java:49)
</code></pre>
</blockquote>

<p><strong>FirstTest.java</strong></p>

<pre><code>package test1;

import java.net.MalformedURLException;
import java.net.URL;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import io.appium.java_client.AppiumDriver;
import io.appium.java_client.ios.IOSDriver;
import io.appium.java_client.ios.IOSElement;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
/*

@author:Hajar
11/03/2016
*/
public class FirstTest {

public static AppiumDriver dr;

public static void main(String[] args)
throws MalformedURLException, InterruptedException{

 DesiredCapabilities capabilities = new DesiredCapabilities();
// Platform de l'emulateur
capabilities.setCapability("platformName","iOS");
// La version de l'emulateur 
capabilities.setCapability("platformVersion", "9.2");
// le nom de l'emulateur
capabilities.setCapability("deviceName","iPad 2");
capabilities.setCapability("bundleId","com.InovaSquad.Artinove");

dr=new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);
 dr.findElement(By.xpath("//UIAApplication[1]/UIAWindow[1]/UIAScrollView[2]/UIAWebView[1]/UIALink[2]/UIAStaticText[1]")).click();
dr.findElement(By.xpath("//UIAApplication[1]/UIAWindow[1]/UIAScrollView[2]/UIAWebView[1]/UIATextField[1]")).sendKeys("ggg");

}
}
</code></pre>

<p>Server logs  :</p>

<blockquote>
  <p>info : [debug] Sending command to instruments:
  au.getElementByIndexPath('/0/0/1/0/1') info: [IOS_SYSLOG_ROW ] Mar 18
  15:39:46 users-iMac mstreamd[70568]: (Note ) PS: Media stream daemon
  stopping. info: [IOS_SYSLOG_ROW ] Mar 18 15:39:46 users-iMac
  mstreamd[70568]: (Note ) AS: :
  Shared Streams daemon has shut down. info: [IOS_SYSLOG_ROW ] Mar 18
  15:39:46 users-iMac mstreamd[70568]: (Warn ) mstreamd: mstreamd
  shutting down.</p>
  
  <p>info: [debug] [INST] 2016-03-18 15:39:46 +0000 Debug: Got new command
  7 from instruments: au.getElementByIndexPath('/0/0/1/0/1') info:
  [debug] [INST] 2016-03-18 15:39:46 +0000 Debug: evaluating
  au.getElementByIndexPath('/0/0/1/0/1')</p>
  
  <p>info: [debug] Socket data received (38 bytes)</p>
  
  <p>info: [debug] Socket data being routed. info: [debug] Got result from
  instruments: {"status":0,"value":{"ELEMENT":"1"}} info: [debug]
  Responding to client with success:
  {"status":0,"value":{"ELEMENT":"1"},"sessionId":"d860df3d-b4be-46a5-8ee4-de67f7d04e55"}
  info: &lt;-- POST
  /wd/hub/session/d860df3d-b4be-46a5-8ee4-de67f7d04e55/element 200
  2387.424 ms - 87 {"status":0,"value":{"ELEMENT":"1"},"sessionId":"d860df3d-b4be-46a5-8ee4-de67f7d04e55"}</p>
  
  <p>info: --> POST
  /wd/hub/session/d860df3d-b4be-46a5-8ee4-de67f7d04e55/element/1/value
  {"id":"1","value":["ggg"]} info: [debug] Pushing command to appium
  work queue: "au.getElement('1').setValueByType('ggg')" info: [debug]
  Sending command to instruments:
  au.getElement('1').setValueByType('ggg') info: [debug] [INST]
  2016-03-18 15:39:46 +0000 Debug: evaluation finished info: [debug]
  [INST] 2016-03-18 15:39:46 +0000 Debug: responding with: info: [debug]
  [INST] 2016-03-18 15:39:46 +0000 Debug: Running system command #8:
  /Applications/Appium.app/Contents/Resources/node/bin/node
  /Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-uiauto/bin/command-proxy-client.js
  /tmp/instruments_sock 2,{"status":0,"value":{"ELEMENT":"1"}}...</p>
  
  <p>info: [debug] [INST] 2016-03-18 15:39:47 +0000 Debug: Got new command
  8 from instruments: au.getElement('1').setValueByType('ggg')</p>
  
  <p>info: [debug] [INST] 2016-03-18 15:39:47 +0000 Debug: evaluating
  au.getElement('1').setValueByType('ggg') info: [debug] [INST]
  2016-03-18 15:39:47 +0000 Debug: No keyboard found. Tapping to make
  visible. info: [debug] [INST] 2016-03-18 15:39:47 +0000 Debug:
  target.frontMostApp().elements()[0].elements()[1].elements()[0].elements()[1].tap()</p>
  
  <p>info: [IOS_SYSLOG_ROW ] Mar 18 15:39:47 users-iMac assertiond[70583]:
  assertion failed: 14F27 13C75: assertiond + 13207
  [792516D1-991E-36EE-8454-16F8220758D6]: 0x1 info: [debug] [INST]
  2016-03-18 15:39:48 +0000 Debug: Still no keyboard found. Tapping
  again to make visible.</p>
  
  <p>info: [debug] [INST] 2016-03-18 15:39:48 +0000 Debug:
  target.frontMostApp().elements()[0].elements()[1].elements()[0].elements()[1].tap()</p>
  
  <p>info: [IOS_SYSLOG_ROW ] Mar 18 15:39:50 --- last message repeated 3
  times --- info: [IOS_SYSLOG_ROW ] Mar 18 15:39:50 users-iMac
  Artinove[70619]: mousedown stop event</p>
  
  <p>info: [IOS_SYSLOG_ROW ] Mar 18 15:39:50 users-iMac assertiond[70583]:
  assertion failed: 14F27 13C75: assertiond + 13207
  [792516D1-991E-36EE-8454-16F8220758D6]: 0x1</p>
  
  <p>info: [debug] [INST] 2016-03-18 15:39:50 +0000 Debug:
  target.frontMostApp().keyboard().typeString("g")</p>
  
  <p>info: [debug] [INST] 2016-03-18 15:39:51 +0000 Debug:
  target.frontMostApp().keyboard() failed to tap 'g'</p>
  
  <p>info: [debug] [INST] 2016-03-18 15:39:51 +0000 Debug: Error typing
  'g': VerboseError: target.frontMostApp().keyboard() failed to tap 'g'</p>
  
  <p>info: [IOS_SYSLOG_ROW ] Mar 18 15:39:51 --- last message repeated 1
  time --- info: [IOS_SYSLOG_ROW ] Mar 18 15:39:51 users-iMac
  kbd[70636]: table drop: 101</p>
  
  <p>info: [debug] [INST] 2016-03-18 15:39:51 +0000 Debug: Retrying...
  info: [debug] [INST] 2016-03-18 15:39:51 +0000 Debug:
  target.frontMostApp().keyboard().typeString("g")</p>
  
  <p>info: [debug] [INST] 2016-03-18 15:39:52 +0000 Debug:
  target.frontMostApp().keyboard() failed to tap 'g'</p>
  
  <p>info: [debug] Socket data received (76 bytes)</p>
</blockquote>

<p>Any assistance would be greatly appreciated!</p>