Safari remote driver not switching back to original window/page

The automation is subject to Salesforce Web Application on iPad - (mobile) Safari
appium version 1.4.8
The appium server conffigurations:-
properties:


java code:
assumeTrue(Platform.MAC.is(current));
/**
* condition - appium server is up and running @url
*/
DesiredCapabilities dCap = new DesiredCapabilities();

		dCap.setCapability("browserName", props.getProperty("iosBrowserName"));
		dCap.setCapability("platformName", props.getProperty("iosPlatformName"));
		dCap.setCapability("platformVersion", props.getProperty("iosPlatformVersion"));
		dCap.setCapability("deviceName", props.getProperty("iosDeviceName"));

// dCap.setCapability(“app”, props.getProperty(“iosApp”));
dCap.setCapability(“orientation”, props.getProperty(“iosDeviceOrientation”));
/** IOS (Sim-only) */
dCap.setCapability(“safariAllowPopups”, “true”);
dCap.setCapability(“safariOpenLinksInBackground”, “true”);
// dCap.setJavascriptEnabled(true);

		URL url = new URL(props.getProperty("iosAppiumUrl"));//"http://localhost:4723/wd/hub")
		
		myDriver = new RemoteWebDriver(url, dCap);

The test scenarios:

  1. click auction event lookup (javascript) to open a new popup window (desktop) a new page on Safari
  2. confirm the lookup value by click on the href (javascript)

The results from the lookup confirmation:

  1. close the new window (desktop) / the new page on mobile safari
  2. send the value from lookup back to the main page

Issue/Bug:
The safari remotewebdriver is stopping working.

The appium log file:
info: --> GET /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element/5170/attribute/title {}
info: [debug] [REMOTE] Executing ‘get_attribute_value’ atom in default context
info: [debug] [REMOTE] Sending javascript command
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] Responding to client with success: {“status”:0,“value”:“Remove”,“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: <-- GET /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element/5170/attribute/title 200 6.463 ms - 80 {“status”:0,“value”:“Remove”,“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: --> GET /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element/5171/attribute/id {}
info: [debug] [REMOTE] Executing ‘get_attribute_value’ atom in default context
info: [debug] [REMOTE] Sending javascript command
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] Responding to client with success: {“status”:0,“value”:“j_id0:form:newLeadBlock:inputEvent_lkwgt”,“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: <-- GET /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element/5171/attribute/id 200 6.907 ms - 114 {“status”:0,“value”:“j_id0:form:newLeadBlock:inputEvent_lkwgt”,“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: --> GET /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element/5171/attribute/title {}
info: [debug] [REMOTE] Executing ‘get_attribute_value’ atom in default context
info: [debug] [REMOTE] Sending javascript command
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] Responding to client with success: {“status”:0,“value”:“Auction Event Lookup (New Window)”,“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: <-- GET /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element/5171/attribute/title 200 6.431 ms - 107 {“status”:0,“value”:“Auction Event Lookup (New Window)”,“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: --> POST /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element/5171/element {“id”:“5171”,“using”:“tag name”,“value”:“img”}
info: [debug] Waiting up to 0ms for condition
info: [debug] [REMOTE] Executing ‘find_element’ atom in default context
info: [debug] [REMOTE] Sending javascript command
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] Responding to client with success: {“status”:0,“value”:{“ELEMENT”:“5172”},“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: <-- POST /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element/5171/element 200 10.575 ms - 90 {“status”:0,“value”:{“ELEMENT”:“5172”},“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: --> GET /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element/5172/displayed {}
info: [debug] [REMOTE] Executing ‘is_displayed’ atom in default context
info: [debug] [REMOTE] Sending javascript command
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] Responding to client with success: {“status”:0,“value”:true,“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: <-- GET /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element/5172/displayed 200 11.712 ms - 76 {“status”:0,“value”:true,“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: --> POST /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element/5172/click {“id”:“5172”}
info: [debug] [REMOTE] Executing ‘click’ atom in default context
info: [debug] [REMOTE] Sending javascript command
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] Responding to client with success: {“status”:0,“value”:null,“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: <-- POST /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element/5172/click 200 2947.442 ms - 76 {“status”:0,“value”:null,“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] {"__argument":{“WIRApplicationIdentifierKey”:“PID:11896”,“WIRListingKey”:{“1”:{“WIRTitleKey”:“New Lead ~ salesforce.com - Unlimited Edition”,“WIRTypeKey”:“WIRTypeWeb”,“WIRURLKey”:“https://rb–test04f–c.cs9.visual.force.com/apex/NewLead”,“WIRPageIdentifierKey”:1,“WIRConnectionIdentifierKey”:“490eb2b2-c521-4456-9cb1-a73348c659fb”},“101”:{“WIRTitleKey”:"",“WIRTypeKey”:“WIRTypeWeb”,“WIRURLKey”:“about:blank”,“WIRPageIdentifierKey”:101}}},"__selector":"_rpc_applicationSentListing:"}
info: [debug] Remote debugger notified us of a new page listing
info: [debug] We have new pages, going to select page 101
info: [debug] [REMOTE] Selecting page 101 and forwarding socket setup
info: [debug] [REMOTE] Sending _rpc_forwardSocketSetup: message to remote debugger
info: [debug] [REMOTE] {"__argument":{“WIRApplicationIdentifierKey”:“PID:11896”,“WIRConnectionIdentifierKey”:“490eb2b2-c521-4456-9cb1-a73348c659fb”,“WIRSenderKey”:“dc371ffa-1619-43a4-89c9-b03e57c7a5be”,“WIRPageIdentifierKey”:101},"__selector":"_rpc_forwardSocketSetup:"}
info: [debug] [REMOTE] Set sender key
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] [REMOTE] Enabled activity on page
info: [debug] [REMOTE] Checking document readyState
info: [debug] [REMOTE] Sending javascript command
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] [REMOTE] readyState was complete
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] [REMOTE] Frame navigated, unloading page
info: [debug] [REMOTE] Frame navigated, calling cbs
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] [REMOTE] Got a blank data response from debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] [REMOTE] Got a blank data response from debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] [REMOTE] Got a blank data response from debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] {"__argument":{“WIRApplicationIdentifierKey”:“PID:11896”,“WIRListingKey”:{“1”:{“WIRTitleKey”:“New Lead ~ salesforce.com - Unlimited Edition”,“WIRTypeKey”:“WIRTypeWeb”,“WIRURLKey”:“https://rb–test04f–c.cs9.visual.force.com/apex/NewLead”,“WIRPageIdentifierKey”:1,“WIRConnectionIdentifierKey”:“490eb2b2-c521-4456-9cb1-a73348c659fb”},“101”:{“WIRTitleKey”:“Search ~ salesforce.com - Unlimited Edition”,“WIRTypeKey”:“WIRTypeWeb”,“WIRURLKey”:“https://rb–test04f–c.cs9.visual.force.com/_ui/common/data/LookupPage?lkfm=j_id0%3Aform&lknm=j_id0%3Aform%3AnewLeadBlock%3AinputEvent&lkfield=00NU0000003pgDl&lkent=00Q&lktp=a11&lksrch=Edmonton%2C%20AB%2C%20CAN%20-%20Dec%2010%2C%202015”,“WIRPageIdentifierKey”:101,“WIRConnectionIdentifierKey”:“490eb2b2-c521-4456-9cb1-a73348c659fb”}}},"__selector":"_rpc_applicationSentListing:"}
info: [debug] Remote debugger notified us of a new page listing
info: [debug] New page listing is same as old, doing nothing
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] [REMOTE] Frame navigated, unloading page
info: [debug] [REMOTE] Frame navigated, calling cbs
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] {"__argument":{“WIRApplicationIdentifierKey”:“PID:11896”,“WIRListingKey”:{“1”:{“WIRTitleKey”:“New Lead ~ salesforce.com - Unlimited Edition”,“WIRTypeKey”:“WIRTypeWeb”,“WIRURLKey”:“https://rb–test04f–c.cs9.visual.force.com/apex/NewLead”,“WIRPageIdentifierKey”:1,“WIRConnectionIdentifierKey”:“490eb2b2-c521-4456-9cb1-a73348c659fb”},“101”:{“WIRTitleKey”:“Search ~ salesforce.com - Unlimited Edition”,“WIRTypeKey”:“WIRTypeWeb”,“WIRURLKey”:“https://rb–test04f–c.cs9.visual.force.com/_ui/common/data/LookupPage?lkfm=j_id0%3Aform&lknm=j_id0%3Aform%3AnewLeadBlock%3AinputEvent&lkfield=00NU0000003pgDl&lkent=00Q&lktp=a11&lksrch=Edmonton%2C%20AB%2C%20CAN%20-%20Dec%2010%2C%202015”,“WIRPageIdentifierKey”:101,“WIRConnectionIdentifierKey”:“490eb2b2-c521-4456-9cb1-a73348c659fb”}}},"__selector":"_rpc_applicationSentListing:"}
info: [debug] Remote debugger notified us of a new page listing
info: [debug] New page listing is same as old, doing nothing
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] [REMOTE] Frame navigated, unloading page
info: [debug] [REMOTE] Frame navigated, calling cbs
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] {"__argument":{“WIRApplicationIdentifierKey”:“PID:11896”,“WIRListingKey”:{“1”:{“WIRTitleKey”:“New Lead ~ salesforce.com - Unlimited Edition”,“WIRTypeKey”:“WIRTypeWeb”,“WIRURLKey”:“https://rb–test04f–c.cs9.visual.force.com/apex/NewLead”,“WIRPageIdentifierKey”:1,“WIRConnectionIdentifierKey”:“490eb2b2-c521-4456-9cb1-a73348c659fb”},“101”:{“WIRTitleKey”:“Search ~ salesforce.com - Unlimited Edition”,“WIRTypeKey”:“WIRTypeWeb”,“WIRURLKey”:“https://rb–test04f–c.cs9.visual.force.com/_ui/common/data/LookupPage?lkfm=j_id0%3Aform&lknm=j_id0%3Aform%3AnewLeadBlock%3AinputEvent&lkfield=00NU0000003pgDl&lkent=00Q&lktp=a11&lksrch=Edmonton%2C%20AB%2C%20CAN%20-%20Dec%2010%2C%202015”,“WIRPageIdentifierKey”:101,“WIRConnectionIdentifierKey”:“490eb2b2-c521-4456-9cb1-a73348c659fb”}}},"__selector":"_rpc_applicationSentListing:"}
info: [debug] Remote debugger notified us of a new page listing
info: [debug] New page listing is same as old, doing nothing
info: --> GET /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/window_handles {}
info: [debug] [REMOTE] Selecting app PID:11896 (try #1)
info: [debug] [REMOTE] function () { [native code] }
info: [debug] [REMOTE] Sending _rpc_forwardGetListing: message to remote debugger
info: [debug] [REMOTE] {"__argument":{“WIRConnectionIdentifierKey”:“490eb2b2-c521-4456-9cb1-a73348c659fb”,“WIRApplicationIdentifierKey”:“PID:11896”},"__selector":"_rpc_forwardGetListing:"}
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] {"__argument":{“WIRApplicationIdentifierKey”:“PID:11896”,“WIRListingKey”:{“1”:{“WIRTitleKey”:“New Lead ~ salesforce.com - Unlimited Edition”,“WIRTypeKey”:“WIRTypeWeb”,“WIRURLKey”:“https://rb–test04f–c.cs9.visual.force.com/apex/NewLead”,“WIRPageIdentifierKey”:1,“WIRConnectionIdentifierKey”:“490eb2b2-c521-4456-9cb1-a73348c659fb”},“101”:{“WIRTitleKey”:“Search ~ salesforce.com - Unlimited Edition”,“WIRTypeKey”:“WIRTypeWeb”,“WIRURLKey”:“https://rb–test04f–c.cs9.visual.force.com/_ui/common/data/LookupPage?lkfm=j_id0%3Aform&lknm=j_id0%3Aform%3AnewLeadBlock%3AinputEvent&lkfield=00NU0000003pgDl&lkent=00Q&lktp=a11&lksrch=Edmonton%2C%20AB%2C%20CAN%20-%20Dec%2010%2C%202015”,“WIRPageIdentifierKey”:101,“WIRConnectionIdentifierKey”:“490eb2b2-c521-4456-9cb1-a73348c659fb”}}},"__selector":"_rpc_applicationSentListing:"}
info: [debug] Responding to client with success: {“status”:0,“value”:[“1”,“101”],“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: <-- GET /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/window_handles 200 3.338 ms - 83 {“status”:0,“value”:[“1”,“101”],“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] [REMOTE] Page loaded, verifying whether ready through readyState
info: [debug] [REMOTE] got applicationSentData response
info: [debug] [REMOTE] Got a blank data response from debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] {"__argument":{“WIRApplicationIdentifierKey”:“PID:11896”,“WIRListingKey”:{“1”:{“WIRTitleKey”:“New Lead ~ salesforce.com - Unlimited Edition”,“WIRTypeKey”:“WIRTypeWeb”,“WIRURLKey”:“https://rb–test04f–c.cs9.visual.force.com/apex/NewLead”,“WIRPageIdentifierKey”:1,“WIRConnectionIdentifierKey”:“490eb2b2-c521-4456-9cb1-a73348c659fb”},“101”:{“WIRTitleKey”:“Search ~ salesforce.com - Unlimited Edition”,“WIRTypeKey”:“WIRTypeWeb”,“WIRURLKey”:“https://rb–test04f–c.cs9.visual.force.com/_ui/common/data/LookupPage?lkfm=j_id0%3Aform&lknm=j_id0%3Aform%3AnewLeadBlock%3AinputEvent&lkfield=00NU0000003pgDl&lkent=00Q&lktp=a11&lksrch=Edmonton%2C%20AB%2C%20CAN%20-%20Dec%2010%2C%202015”,“WIRPageIdentifierKey”:101,“WIRConnectionIdentifierKey”:“490eb2b2-c521-4456-9cb1-a73348c659fb”}}},"__selector":"_rpc_applicationSentListing:"}
info: [debug] Remote debugger notified us of a new page listing
info: [debug] New page listing is same as old, doing nothing
info: [debug] [REMOTE] Checking document readyState
info: [debug] [REMOTE] Sending javascript command
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] [REMOTE] readyState was complete
info: [debug] [REMOTE] Page is ready, calling onload cbs
info: --> POST /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/window {“name”:“101”}
info: [debug] [REMOTE] Selecting page 101 and forwarding socket setup
info: [debug] [REMOTE] Sending _rpc_forwardSocketSetup: message to remote debugger
info: [debug] [REMOTE] {"__argument":{“WIRApplicationIdentifierKey”:“PID:11896”,“WIRConnectionIdentifierKey”:“490eb2b2-c521-4456-9cb1-a73348c659fb”,“WIRSenderKey”:“dc371ffa-1619-43a4-89c9-b03e57c7a5be”,“WIRPageIdentifierKey”:101},"__selector":"_rpc_forwardSocketSetup:"}
info: [debug] [REMOTE] Set sender key
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] [REMOTE] Enabled activity on page
info: [debug] [REMOTE] Checking document readyState
info: [debug] [REMOTE] Sending javascript command
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] [REMOTE] readyState was complete
info: [debug] Responding to client with success: {“status”:0,“value”:"",“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: <-- POST /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/window 200 6.587 ms - 74 {“status”:0,“value”:"",“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: --> POST /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element {“using”:“id”,“value”:“searchFrame”}
info: [debug] Waiting up to 0ms for condition
info: [debug] [REMOTE] Executing ‘find_element’ atom in default context
info: [debug] [REMOTE] Sending javascript command
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] Responding to client with success: {“status”:0,“value”:{“ELEMENT”:“5173”},“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: <-- POST /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element 200 10.074 ms - 90 {“status”:0,“value”:{“ELEMENT”:“5173”},“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: --> GET /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element/5173/displayed {}
info: [debug] [REMOTE] Executing ‘is_displayed’ atom in default context
info: [debug] [REMOTE] Sending javascript command
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] Responding to client with success: {“status”:0,“value”:true,“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: <-- GET /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element/5173/displayed 200 10.254 ms - 76 {“status”:0,“value”:true,“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: --> POST /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element {“using”:“id”,“value”:“resultsFrame”}
info: [debug] Waiting up to 0ms for condition
info: [debug] [REMOTE] Executing ‘find_element’ atom in default context
info: [debug] [REMOTE] Sending javascript command
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] Responding to client with success: {“status”:0,“value”:{“ELEMENT”:“5174”},“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: <-- POST /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element 200 9.148 ms - 90 {“status”:0,“value”:{“ELEMENT”:“5174”},“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: --> GET /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element/5174/displayed {}
info: [debug] [REMOTE] Executing ‘is_displayed’ atom in default context
info: [debug] [REMOTE] Sending javascript command
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] Responding to client with success: {“status”:0,“value”:true,“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: <-- GET /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element/5174/displayed 200 9.162 ms - 76 {“status”:0,“value”:true,“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: --> POST /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/frame {“id”:“resultsFrame”}
info: [debug] [REMOTE] Executing ‘frame_by_id_or_name’ atom in default context
info: [debug] [REMOTE] Sending javascript command
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] Entering new web frame: :wdc:1437673233596
info: [debug] Responding to client with success: {“status”:0,“value”:{“WINDOW”:":wdc:1437673233596"},“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: <-- POST /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/frame 200 9.808 ms - 103 {“status”:0,“value”:{“WINDOW”:":wdc:1437673233596"},“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: --> POST /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element {“using”:“link text”,“value”:“Edmonton, AB, CAN - Dec 10, 2015”}
info: [debug] Waiting up to 0ms for condition
info: [debug] [REMOTE] Wrapping script for frame :wdc:1437673233596
info: [debug] [REMOTE] Sending javascript command
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] Responding to client with success: {“status”:0,“value”:{“ELEMENT”:“5175”},“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: <-- POST /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element 200 19.640 ms - 90 {“status”:0,“value”:{“ELEMENT”:“5175”},“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: --> GET /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element/5175/displayed {}
info: [debug] [REMOTE] Wrapping script for frame :wdc:1437673233596
info: [debug] [REMOTE] Sending javascript command
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] Responding to client with success: {“status”:0,“value”:true,“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: <-- GET /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element/5175/displayed 200 11.831 ms - 76 {“status”:0,“value”:true,“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: --> GET /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element/5175/enabled {}
info: [debug] [REMOTE] Wrapping script for frame :wdc:1437673233596
info: [debug] [REMOTE] Sending javascript command
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] Responding to client with success: {“status”:0,“value”:true,“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: <-- GET /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element/5175/enabled 200 9.553 ms - 76 {“status”:0,“value”:true,“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: --> GET /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/window_handles {}
info: [debug] [REMOTE] Selecting app PID:11896 (try #1)
info: [debug] [REMOTE] function () { [native code] }
info: [debug] [REMOTE] Sending _rpc_forwardGetListing: message to remote debugger
info: [debug] [REMOTE] {"__argument":{“WIRConnectionIdentifierKey”:“490eb2b2-c521-4456-9cb1-a73348c659fb”,“WIRApplicationIdentifierKey”:“PID:11896”},"__selector":"_rpc_forwardGetListing:"}
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] {"__argument":{“WIRApplicationIdentifierKey”:“PID:11896”,“WIRListingKey”:{“1”:{“WIRTitleKey”:“New Lead ~ salesforce.com - Unlimited Edition”,“WIRTypeKey”:“WIRTypeWeb”,“WIRURLKey”:“https://rb–test04f–c.cs9.visual.force.com/apex/NewLead”,“WIRPageIdentifierKey”:1,“WIRConnectionIdentifierKey”:“490eb2b2-c521-4456-9cb1-a73348c659fb”},“101”:{“WIRTitleKey”:“Search ~ salesforce.com - Unlimited Edition”,“WIRTypeKey”:“WIRTypeWeb”,“WIRURLKey”:“https://rb–test04f–c.cs9.visual.force.com/_ui/common/data/LookupPage?lkfm=j_id0%3Aform&lknm=j_id0%3Aform%3AnewLeadBlock%3AinputEvent&lkfield=00NU0000003pgDl&lkent=00Q&lktp=a11&lksrch=Edmonton%2C%20AB%2C%20CAN%20-%20Dec%2010%2C%202015”,“WIRPageIdentifierKey”:101,“WIRConnectionIdentifierKey”:“490eb2b2-c521-4456-9cb1-a73348c659fb”}}},"__selector":"_rpc_applicationSentListing:"}
info: [debug] Responding to client with success: {“status”:0,“value”:[“1”,“101”],“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: <-- GET /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/window_handles 200 3.205 ms - 83 {“status”:0,“value”:[“1”,“101”],“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: --> POST /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element {“using”:“link text”,“value”:“Edmonton, AB, CAN - Dec 10, 2015”}
info: [debug] Waiting up to 0ms for condition
info: [debug] [REMOTE] Wrapping script for frame :wdc:1437673233596
info: [debug] [REMOTE] Sending javascript command
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] Responding to client with success: {“status”:0,“value”:{“ELEMENT”:“5176”},“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: <-- POST /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element 200 16.261 ms - 90 {“status”:0,“value”:{“ELEMENT”:“5176”},“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: --> GET /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element/5176/displayed {}
info: [debug] [REMOTE] Wrapping script for frame :wdc:1437673233596
info: [debug] [REMOTE] Sending javascript command
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] Responding to client with success: {“status”:0,“value”:true,“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: <-- GET /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element/5176/displayed 200 11.358 ms - 76 {“status”:0,“value”:true,“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: --> POST /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element/5176/click {“id”:“5176”}
info: [debug] [REMOTE] Wrapping script for frame :wdc:1437673233596
info: [debug] [REMOTE] Sending javascript command
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] Responding to client with success: {“status”:0,“value”:null,“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: <-- POST /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element/5176/click 200 35.205 ms - 76 {“status”:0,“value”:null,“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] [REMOTE] Got a blank data response from debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] [REMOTE] Got a blank data response from debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] [REMOTE] Got a blank data response from debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] {"__argument":{“WIRApplicationIdentifierKey”:“PID:11896”,“WIRListingKey”:{“1”:{“WIRTitleKey”:“New Lead ~ salesforce.com - Unlimited Edition”,“WIRTypeKey”:“WIRTypeWeb”,“WIRURLKey”:“https://rb–test04f–c.cs9.visual.force.com/apex/NewLead”,“WIRPageIdentifierKey”:1,“WIRConnectionIdentifierKey”:“490eb2b2-c521-4456-9cb1-a73348c659fb”}}},"__selector":"_rpc_applicationSentListing:"}
info: [debug] Remote debugger notified us of a new page listing
info: [debug] New page listing from remote debugger doesn’t contain current window, let’s assume it’s closed
info: [debug] Debugger already selected page 1, confirming that choice.
info: --> POST /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/window {“name”:“1”}
info: [debug] [REMOTE] Selecting page 1 and forwarding socket setup
info: [debug] [REMOTE] Sending _rpc_forwardSocketSetup: message to remote debugger
info: [debug] [REMOTE] {"__argument":{“WIRApplicationIdentifierKey”:“PID:11896”,“WIRConnectionIdentifierKey”:“490eb2b2-c521-4456-9cb1-a73348c659fb”,“WIRSenderKey”:“dc371ffa-1619-43a4-89c9-b03e57c7a5be”,“WIRPageIdentifierKey”:1},"__selector":"_rpc_forwardSocketSetup:"}
info: [debug] [REMOTE] Set sender key
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] [REMOTE] Enabled activity on page
info: [debug] [REMOTE] Checking document readyState
info: [debug] [REMOTE] Sending javascript command
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] [REMOTE] readyState was complete
info: [debug] Responding to client with success: {“status”:0,“value”:"",“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: <-- POST /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/window 200 6.109 ms - 74 {“status”:0,“value”:"",“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: --> POST /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/window {“name”:“1”}
info: [debug] [REMOTE] Selecting page 1 and forwarding socket setup
info: [debug] [REMOTE] Sending _rpc_forwardSocketSetup: message to remote debugger
info: [debug] [REMOTE] {"__argument":{“WIRApplicationIdentifierKey”:“PID:11896”,“WIRConnectionIdentifierKey”:“490eb2b2-c521-4456-9cb1-a73348c659fb”,“WIRSenderKey”:“dc371ffa-1619-43a4-89c9-b03e57c7a5be”,“WIRPageIdentifierKey”:1},"__selector":"_rpc_forwardSocketSetup:"}
info: [debug] [REMOTE] Set sender key
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] [REMOTE] Enabled activity on page
info: [debug] [REMOTE] Checking document readyState
info: [debug] [REMOTE] Sending javascript command
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] [REMOTE] readyState was complete
info: [debug] Responding to client with success: {“status”:0,“value”:"",“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: <-- POST /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/window 200 5.340 ms - 74 {“status”:0,“value”:"",“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: --> POST /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element {“using”:“name”,“value”:“new_lead”}
info: [debug] Waiting up to 0ms for condition
info: [debug] [REMOTE] Wrapping script for frame :wdc:1437673233596
info: [debug] [REMOTE] Sending javascript command
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] Condition unmet after 6ms. Timing out.
info: [debug] Responding to client with error: {“status”:13,“value”:{“message”:“An unknown server-side error occurred while processing the command.”,“origValue”:“Did not get OK result from execute(). Result was: {“type”:“object”,“objectId”:”{\“injectedScriptId\”:7,\“id\”:1}",“className”:“Object”,“description”:“StaleElementReferenceError: Element does not exist in cache”}"},“sessionId”:“d309eacd-786c-4cfc-bbaf-59208121e7c5”}
info: <-- POST /wd/hub/session/d309eacd-786c-4cfc-bbaf-59208121e7c5/element 500 7.950 ms - 404
^

I met the same issue… how do you figure it out?..

no solution yet.
anyway, try not to use switch to frame on iPad test.

not sure if I can be in the position to help you out. feel free to send me more details about your issue.