Hi,
I have starting using appium for testing of our mobile web app. Unfortunately it runs in an cross-origin iframe and Appium appears to have difficult accessing web elements in the iframe. I have setup a simple test page which contains a local iframe (same domain as parent) and a cross-origin iframe. Appium has no issue with accessing the local iframe content but fails when attempting to access elements within cross-origin iframe. Is this a known issue or does it sound like a bug. My WebDriver tests appear to work using chromedriver. I am new to Appium and was drawing to it as I would not need to change our internal testing framework which is Java/WebDriver based. I am stuck with this issues as our mobile app runs within Salesforce's environment so have no control over the use of iframes.
I see that switching to the cross-origin iframe seems to work, from the logs:
info: Entering new web frame: :wdc:1394013932388
info: Responding to client with success: {"status":0,"value":{"WINDOW":":wdc:1394013932388"},"sessionId":"539b787f-efa1-4060-b3fb-511549e5be1f"}
But when I attempt to access an element in the iframe I get the error "undefined' is not an object ", see below:
debug: Appium request initiated at /wd/hub/session/539b787f-efa1-4060-b3fb-511549e5be1f/element
debug: Request received with params: {"using":"xpath","value":"//table[@class='snowrep']"}
info: [REMOTE] Wrapping script for frame :wdc:1394013932388
info: [REMOTE] Sending javascript command
debug: [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
debug: [REMOTE] Receiving data from remote debugger
debug: [REMOTE] Receiving data from remote debugger
debug: [REMOTE] <applicationSentData response>
info: Responding to client with error: {"status":13,"value":{"message":"'undefined' is not an object (evaluating 'a.nodeType')","origValue":"'undefined' is not an object (evaluating 'a.nodeType')"},"sessionId":"539b787f-efa1-4060-b3fb-511549e5be1f"}
So again,not sure if this is a bug, know issue or limitation of the system. Hope its not a limitation as I would really like to use Appium. Any help would be appreciated.
Regards,
Kieran
---------------------------------------
Log extract below:
info: Responding to client with success: {"status":0,"value":{"ELEMENT":"5005"},"sessionId":"539b787f-efa1-4060-b3fb-511549e5be1f"}
POST /wd/hub/session/539b787f-efa1-4060-b3fb-511549e5be1f/element 200 13ms - 112b
debug: Appium request initiated at /wd/hub/session/539b787f-efa1-4060-b3fb-511549e5be1f/frame
debug: Request received with params: {"id":{"ELEMENT":"5005"}}
nfo: [REMOTE] Executing 'get_frame_window' atom in default context
info: [REMOTE] Sending javascript command
debug: [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
debug: [REMOTE] Receiving data from remote debugger
debug: [REMOTE] <applicationSentData response>
info: Entering new web frame: :wdc:1394013932388
info: Responding to client with success: {"status":0,"value":{"WINDOW":":wdc:1394013932388"},"sessionId":"539b787f-efa1-4060-b3fb-511549e5be1f"}
POST /wd/hub/session/539b787f-efa1-4060-b3fb-511549e5be1f/frame 200 7ms - 125b
debug: Appium request initiated at /wd/hub/session/539b787f-efa1-4060-b3fb-511549e5be1f/element
debug: Request received with params: {"using":"xpath","value":"//table[@class='snowrep']"}
info: [REMOTE] Wrapping script for frame :wdc:1394013932388
info: [REMOTE] Sending javascript command
debug: [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
debug: [REMOTE] Receiving data from remote debugger
debug: [REMOTE] Receiving data from remote debugger
debug: [REMOTE] <applicationSentData response>
info: Responding to client with error: {"status":13,"value":{"message":"'undefined' is not an object (evaluating 'a.nodeType')","origValue":"'undefined' is not an object (evaluating 'a.nodeType')"},"sessionId":"539b787f-efa1-4060-b3fb-511549e5be1f"}
POST /wd/hub/session/539b787f-efa1-4060-b3fb-511549e5be1f/element 500 10ms - 238b
info: Didn't get a new command in 60 secs, shutting down...
info: Shutting down appium session...
info: Stopping ios
debug: [REMOTE] Receiving data from remote debugger
debug: [REMOTE] Receiving data from remote debugger
debug: [REMOTE] { __selector: '_rpc_applicationDisconnected:',