Hi,
I have a problem making a click work in a hybrid application in Cordova running on iOS.
I tried the xpath locator strategy, but switched to css and I can click the element (gives a 200) but nothing visually happens in the iOS simulator i see.
Any ideas?
Below is the test :
it(“should get life saving rules”, function () {
return driver
.context(‘WEBVIEW_1’)
.elementByCss(‘.page_home_articles’).click()
.elementByCss(‘.page_home_articles > div:first-of-type’).click()
.sleep(3000)
.context(‘NATIVE_APP’)
});
Below is a screenshot of the safari inspector where got the css from:
Here are the test runs and logs for this particular test:
testrun:
CALL context(“WEBVIEW_1”)
POST /session/:sessionID/context {“name”:“WEBVIEW_1”}
RESPONSE context(“WEBVIEW_1”)
CALL elementByCss(“.page_home_articles”)
POST /session/:sessionID/element {“using”:“css selector”,“value”:“.page_home_articles”}
RESPONSE elementByCss(“.page_home_articles”) {“ELEMENT”:“5000”}
CALL element.click()
POST /session/:sessionID/element/5000/click
RESPONSE element.click()
CALL elementByCss(“.page_home_articles > div:first-of-type”)
POST /session/:sessionID/element {“using”:“css selector”,“value”:“.page_home_articles > div:first-of-type”}
RESPONSE elementByCss(“.page_home_articles > div:first-of-type”) {“ELEMENT”:“5001”}
CALL element.click()
POST /session/:sessionID/element/5001/click
RESPONSE element.click()
CALL element.sleep(3000)
RESPONSE element.sleep(3000)
CALL context(“NATIVE_APP”)
POST /session/:sessionID/context {“name”:“NATIVE_APP”}
RESPONSE context(“NATIVE_APP”)
appium log:
info: [debug] Responding to client with success: {“status”:0,“value”:“”,“sessionId”:“09607e3d-6a4a-4ea6-8460-81ee30092ed1”}
info: ← POST /wd/hub/session/09607e3d-6a4a-4ea6-8460-81ee30092ed1/element/0/click 200 1210.264 ms - 74 {“status”:0,“value”:“”,“sessionId”:“09607e3d-6a4a-4ea6-8460-81ee30092ed1”}
info: → POST /wd/hub/session/09607e3d-6a4a-4ea6-8460-81ee30092ed1/context {“name”:“WEBVIEW_1”}
info: [debug] Attempting to set context to ‘WEBVIEW_1’
info: [debug] [REMOTE] useNewSafari → false
info: [debug] [REMOTE] Debugger socket connected to ::1:27753
info: [debug] [REMOTE] Sending connection key
info: [debug] [REMOTE] Sending _rpc_reportIdentifier: message to remote debugger
info: [debug] [REMOTE] {“__argument”:{“WIRConnectionIdentifierKey”:“83b91124-9e05-4133-b496-3aa1bff8f830”},“__selector”:“_rpc_reportIdentifier:”}
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] {“__argument”:{“WIRSimulatorBuildKey”:“13C75”,“WIRSimulatorProductVersionKey”:“9.2”,“WIRSimulatorNameKey”:“iPad”},“__selector”:“_rpc_reportSetup:”}
info: [debug] [REMOTE] Sim name: iPad
info: [debug] [REMOTE] Sim build: 13C75
info: [debug] [REMOTE] {“__argument”:{“WIRApplicationDictionaryKey”:{“PID:2475”:{“WIRApplicationIdentifierKey”:“PID:2475”,“WIRIsApplicationProxyKey”:false,“WIRApplicationNameKey”:“Samen Veilig”,“WIRApplicationBundleIdentifierKey”:“com.appseven.samen-veilig”,“WIRIsApplicationActiveKey”:1}}},“__selector”:“_rpc_reportConnectedApplicationList:”}
info: [debug] Using remote debugger app key: PID:2475
info: [debug] [REMOTE] Selecting app PID:2475 (try #1 of 16)
info: [debug] [REMOTE] Sending _rpc_forwardGetListing: message to remote debugger
info: [debug] [REMOTE] {“__argument”:{“WIRConnectionIdentifierKey”:“83b91124-9e05-4133-b496-3aa1bff8f830”,“WIRApplicationIdentifierKey”:“PID:2475”},“__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:2475”,“WIRListingKey”:{“1”:{“WIRTypeKey”:“WIRTypeWeb”,“WIRTitleKey”:“Veiligheids app”,“WIRURLKey”:“file:///Users/joostevertse/Library/Developer/CoreSimulator/Devices/36894A09-9173-4EEE-A096-CC0319B22B88/data/Containers/Bundle/Application/3DF57AA0-1CAB-4C7C-87C6-317A9EB4FA4D/Samen%20Veilig.app/www/index.html”,“WIRPageIdentifierKey”:1}}},“__selector”:“_rpc_applicationSentListing:”}
info: [debug] [REMOTE] Connected to app PID:2475 [[{“id”:1,“title”:“Veiligheids app”,“url”:“file:///Users/joostevertse/Library/Developer/CoreSimulator/Devices/36894A09-9173-4EEE-A096-CC0319B22B88/data/Containers/Bundle/Application/3DF57AA0-1CAB-4C7C-87C6-317A9EB4FA4D/Samen%20Veilig.app/www/index.html”,“isKey”:false}]]
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:2475”,“WIRConnectionIdentifierKey”:“83b91124-9e05-4133-b496-3aa1bff8f830”,“WIRSenderKey”:“35cbeb06-0eb5-4348-9f95-5195191abc62”,“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] 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”:“09607e3d-6a4a-4ea6-8460-81ee30092ed1”}
info: ← POST /wd/hub/session/09607e3d-6a4a-4ea6-8460-81ee30092ed1/context 200 922.259 ms - 74 {“status”:0,“value”:“”,“sessionId”:“09607e3d-6a4a-4ea6-8460-81ee30092ed1”}
info: → POST /wd/hub/session/09607e3d-6a4a-4ea6-8460-81ee30092ed1/element {“using”:“css selector”,“value”:“.page_home_articles”}
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] {“__argument”:{“WIRApplicationIdentifierKey”:“PID:2475”,“WIRListingKey”:{“1”:{“WIRTypeKey”:“WIRTypeWeb”,“WIRTitleKey”:“Veiligheids app”,“WIRURLKey”:“file:///Users/joostevertse/Library/Developer/CoreSimulator/Devices/36894A09-9173-4EEE-A096-CC0319B22B88/data/Containers/Bundle/Application/3DF57AA0-1CAB-4C7C-87C6-317A9EB4FA4D/Samen%20Veilig.app/www/index.html”,“WIRConnectionIdentifierKey”:“83b91124-9e05-4133-b496-3aa1bff8f830”,“WIRPageIdentifierKey”:1}}},“__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] Redirected from ‘undefined’ to ‘file:///Users/joostevertse/Library/Developer/CoreSimulator/Devices/36894A09-9173-4EEE-A096-CC0319B22B88/data/Containers/Bundle/Application/3DF57AA0-1CAB-4C7C-87C6-317A9EB4FA4D/Samen%20Veilig.app/www/index.html’
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”:{“ELEMENT”:“5000”},“sessionId”:“09607e3d-6a4a-4ea6-8460-81ee30092ed1”}
info: ← POST /wd/hub/session/09607e3d-6a4a-4ea6-8460-81ee30092ed1/element 200 70.360 ms - 90 {“status”:0,“value”:{“ELEMENT”:“5000”},“sessionId”:“09607e3d-6a4a-4ea6-8460-81ee30092ed1”}
info: → POST /wd/hub/session/09607e3d-6a4a-4ea6-8460-81ee30092ed1/element/5000/click {}
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] got applicationSentData response
info: [debug] Responding to client with success: {“status”:0,“value”:null,“sessionId”:“09607e3d-6a4a-4ea6-8460-81ee30092ed1”}
info: ← POST /wd/hub/session/09607e3d-6a4a-4ea6-8460-81ee30092ed1/element/5000/click 200 65.496 ms - 76 {“status”:0,“value”:null,“sessionId”:“09607e3d-6a4a-4ea6-8460-81ee30092ed1”}
info: → POST /wd/hub/session/09607e3d-6a4a-4ea6-8460-81ee30092ed1/element {“using”:“css selector”,“value”:“.page_home_articles > div:first-of-type”}
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”:“5001”},“sessionId”:“09607e3d-6a4a-4ea6-8460-81ee30092ed1”}
info: ← POST /wd/hub/session/09607e3d-6a4a-4ea6-8460-81ee30092ed1/element 200 16.581 ms - 90 {“status”:0,“value”:{“ELEMENT”:“5001”},“sessionId”:“09607e3d-6a4a-4ea6-8460-81ee30092ed1”}
info: → POST /wd/hub/session/09607e3d-6a4a-4ea6-8460-81ee30092ed1/element/5001/click {}
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] got applicationSentData response
info: [debug] Responding to client with success: {“status”:0,“value”:null,“sessionId”:“09607e3d-6a4a-4ea6-8460-81ee30092ed1”}
info: ← POST /wd/hub/session/09607e3d-6a4a-4ea6-8460-81ee30092ed1/element/5001/click 200 80.061 ms - 76 {“status”:0,“value”:null,“sessionId”:“09607e3d-6a4a-4ea6-8460-81ee30092ed1”}
info: → POST /wd/hub/session/09607e3d-6a4a-4ea6-8460-81ee30092ed1/context {“name”:“NATIVE_APP”}
info: [debug] Attempting to set context to ‘NATIVE_APP’