Application closed without running the script

Hi,

I have written script for Android which i am trying to run in the IOS. I have changed the capabilities setting accordingly. But IOS simulator opens the application and close it after a while without executing any script. Can anyone please help me. Thanks in advance. Appium logs are given below :

Appuim Version : 1.6.5
Xcode : 8.0

Appium Logs :

[BaseDriver] Waited for 49573 ms so far
[JSONWP Proxy] Proxying [POST /elements] to [POST http://localhost:8100/session/89CA7806-B4DF-4005-A9F4-4B5552FED7A3/elements] with body: {“using”:“id”,“value”:“com.android.packageinstaller:id/permission_message”}
[JSONWP Proxy] Got response with status 200: {“value”:[],“sessionId”:“89CA7806-B4DF-4005-A9F4-4B5552FED7A3”,“status”:0}
[MJSONWP] Responding to client with driver.findElements() result: []
[HTTP] <-- POST /wd/hub/session/5129f111-1803-4a4d-af48-98403767ce8a/elements 200 50250 ms - 74
[HTTP] --> POST /wd/hub/session/5129f111-1803-4a4d-af48-98403767ce8a/appium/app/close {}
[MJSONWP] Calling AppiumDriver.closeApp() with args: [“5129f111-1803-4a4d-af48-98403767ce8a”]
[XCUITest] Executing command ‘closeApp’
[JSONWP Proxy] Proxying [DELETE /session/5129f111-1803-4a4d-af48-98403767ce8a] to [DELETE http://localhost:8100/session/89CA7806-B4DF-4005-A9F4-4B5552FED7A3] with no body
[JSONWP Proxy] Got response with status 200: “{\n “value” : {\n\n },\n “sessionId” : “8A089A61-D013-474B-B67F-373D53C30BFE”,\n “status” : 0\n}”
[XCUITest] Shutting down sub-processes
[XCUITest] Shutting down xcodebuild process (pid 16659)
[XCUITest] xcodebuild exited with code ‘null’ and signal ‘SIGTERM’
[iOS] Successfully closed the ‘/Users/lalithsharma/Desktop/apps/TKLMobile/platforms/ios/build/emulator/TKLMobile.app’ app.
[MJSONWP] Responding to client with driver.closeApp() result: null
[HTTP] <-- POST /wd/hub/session/5129f111-1803-4a4d-af48-98403767ce8a/appium/app/close 200 191 ms - 76
[HTTP] --> POST /wd/hub/session/5129f111-1803-4a4d-af48-98403767ce8a/timeouts {“type”:“implicit”,“ms”:10000}
[MJSONWP] Calling AppiumDriver.timeouts() with args: [“implicit”,10000,“5129f111-1803-4a4d-af48-98403767ce8a”]
[XCUITest] Executing command ‘timeouts’
[BaseDriver] Set implicit wait to 10000ms
[MJSONWP] Responding to client with driver.timeouts() result: null
[HTTP] <-- POST /wd/hub/session/5129f111-1803-4a4d-af48-98403767ce8a/timeouts 200 2 ms - 76
[HTTP] --> POST /wd/hub/session/5129f111-1803-4a4d-af48-98403767ce8a/elements {“using”:“xpath”,“value”:"//android.view.View[contains(@content-desc,‘TKL Home’)]"}
[MJSONWP] Calling AppiumDriver.findElements() with args: [“xpath”,"//android.view.View[contains(@content-desc,‘TKL Home’)]",“5129f111-1803-4a4d-af48-98403767ce8a”]
[XCUITest] Executing command ‘findElements’
[BaseDriver] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id
[BaseDriver] Waiting up to 10000 ms for condition
[BaseDriver] Waited for 1 ms so far
[BaseDriver] Waited for 505 ms so far
[BaseDriver] Waited for 1008 ms so far
[BaseDriver] Waited for 1510 ms so f

You are running on iOS but trying to find an Android element

//android.view.View[contains(@content-desc,‘TKL Home’)]

So will there not be a common locators for both Android and IOS?? do we have to capture them differently??

Element classes are different. IF both have same ids or other identifiers. Generally for most of the native apps, they are different

ok thanks for the reply…i guess i have to write the complete suite again for IOS :frowning: