Ios - session expire right after login

Hi I am able to record in my app the process from login to main page then logout. but when i run the test script, right after entering the credential it is showing session expired page afterwards. I tried the process manually (non automated) Im able to login then main page then logout.

Session expired for the app is set to 5 minutes.

Here’s my test script:

Mobile.startApplication(‘/Users/Afz/Documents/Build/6.0/SAMPLE_2.0.ipa’, false)

Mobile.tap(findTestObject(‘AAA/IOS/Logon/XCUIElementTypeButton - OK’), 2)

Mobile.setText(findTestObject(‘AAA/IOS/Logon/XCUIElementTypeSecureTextField - Enter PIN’), ‘123456’, 2)

Mobile.tap(findTestObject(‘AAA/IOS/Logon/XCUIElementTypeButton - ic navicon 3bar’), 2)

Mobile.tap(findTestObject(‘AAA/IOS/Logon/XCUIElementTypeStaticText - Sign Out’), 2)

Mobile.closeApplication()

Here’s Appium:

09-14-2018 06:30:51 PM - [START] - Start Test Case : Test Cases/AAA/IOS/Logon/Login

09-14-2018 06:30:51 PM - [INFO] - Evaluating variables for test case

09-14-2018 06:30:52 PM - [START] - Start action : startApplication

09-14-2018 06:30:52 PM - [INFO] - Starting app at: ‘/Users/Afz/Documents/Build/6.0/SAMPLE_2.0.ipa’

09-14-2018 06:30:53 PM - [INFO] - ios_webkit_debug_proxy server started on port 53547

09-14-2018 06:30:56 PM - [INFO] - Appium server started on port 53,553

[Appium] Welcome to Appium v1.8.1

[Appium] Non-default server args:

[Appium] port: 53553

[Appium] loglevel: info

[Appium] chromeDriverPort: 53554

[Appium] tmpDir: /var/folders/mk/4pcyp04x6zq6ylx9qv2fp8xr0000gp/T//Katalon/Appium/Temp1536921053041

[Appium] webkitDebugProxyPort: 53547

[Appium] Appium REST http interface listener started on 0.0.0.0:53553

[HTTP] --> GET /wd/hub/status

[HTTP] {}

[HTTP] <-- GET /wd/hub/status 200 17 ms - 83

[HTTP]

[HTTP] --> POST /wd/hub/session

[HTTP] {“desiredCapabilities”:{“app”:"/Users/Afz/Documents/Build/6.0/SAMPLE_2.0.ipa",“automationName”:“XCUITest”,“deviceName”:“Afz’s Ipad”,“fullReset”:false,“newCommandTimeout”:1800,“noReset”:true,“platformName”:“iOS”,“realDeviceLogger”:"/Applications/Katalon Studio.app/Contents/Eclipse/configuration/resources/tools/deviceconsole/deviceconsole",“udid”:“a675a546d2455ce8dd12345678901d6a7db875c3”,“waitForAppScript”:“true;”,“wdaLocalPort”:53546},“capabilities”:{“desiredCapabilities”:{“app”:"/Users/Afz/Documents/Build/6.0/SAMPLE_2.0.ipa",“automationName”:“XCUITest”,“deviceName”:“Afz’s Ipad”,“fullReset”:false,“newCommandTimeout”:1800,“noReset”:true,“platformName”:“iOS”,“realDeviceLogger”:"/Applications/Katalon Studio.app/Contents/Eclipse/configuration/resources/tools/deviceconsole/deviceconsole",“udid”:“a675a546d2455ce8dd12345678901d6a7db875c3”,“waitForAppScript”:“true;”,“wdaLocalPort”:53546},“firstMatch”:[{"platformN

[Appium] Could not parse W3C capabilities: ‘deviceName’ can’t be blank. Falling back to JSONWP protocol.

[Appium] The following capabilities were provided in the JSONWP desired capabilities that are missing in W3C capabilities: [“app”,“automationName”,“deviceName”,“fullReset”,“newCommandTimeout”,“noReset”,“platformName”,“realDeviceLogger”,“udid”,“waitForAppScript”,“wdaLocalPort”]. Falling back to JSONWP protocol.

[Appium] Creating new XCUITestDriver (v2.84.0) session

[Appium] Capabilities:

[Appium] app: /Users/Afz/Documents/Build/6.0/SAMPLE_2.0.ipa

[Appium] automationName: XCUITest

[Appium] deviceName: Afz’s Ipad

[Appium] fullReset: false

[Appium] newCommandTimeout: 1800

[Appium] noReset: true

[Appium] platformName: iOS

[Appium] realDeviceLogger: /Applications/Katalon Studio.app/Contents/Eclipse/configuration/resources/tools/deviceconsole/deviceconsole

[Appium] udid: a675a546d2455ce8dd12345678901d6a7db875c3

[Appium] waitForAppScript: true;

[Appium] wdaLocalPort: 53546

[BaseDriver] Session created with session id: 28c052d5-4ced-4c1d-b9a3-118b30c46b05

[XCUITest] Determining device to run tests on: udid: ‘a675a546d2455ce8dd12345678901d6a7db875c3’, real device: true

[BaseDriver] Using local app ‘/Users/Afz/Documents/Build/6.0/SAMPLE_2.0.ipa’

[BaseDriver] Unzipping local app ‘/var/folders/mk/4pcyp04x6zq6ylx9qv2fp8xr0000gp/T/2018814-33783-1l1nw2o.92o7/appium-app.zip’…

[BaseDriver] Unzipped local app to ‘/var/folders/mk/4pcyp04x6zq6ylx9qv2fp8xr0000gp/T/2018814-33783-1l1nw2o.92o7/Payload/SAMPLE.app’

[XCUITest] Setting up real device

[XCUITest] Using WDA path: ‘/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent’

[XCUITest] Using WDA agent: ‘/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj’

[XCUITest] Launching WebDriverAgent on the device

[XCUITest] Cannot parse major and minor version numbers from platformVersion “null”. Will build for the default platform instead

Sep 14, 2018 6:31:17 PM org.openqa.selenium.remote.ProtocolHandshake createSession

INFO: Detected dialect: OSS

09-14-2018 06:31:17 PM - [RUN_DATA] - Logging run data ‘appiumVersion’ with value ‘1.8.1’

09-14-2018 06:31:17 PM - [RUN_DATA] - Logging run data ‘deviceId’ with value ‘a675a546d2455ce8dd12345678901d6a7db875c3’

09-14-2018 06:31:17 PM - [RUN_DATA] - Logging run data ‘deviceName’ with value ‘Afz’s Ipad’

09-14-2018 06:31:17 PM - [RUN_DATA] - Logging run data ‘deviceModel’ with value ‘iPad7,6’

09-14-2018 06:31:17 PM - [RUN_DATA] - Logging run data ‘deviceManufacturer’ with value ‘Apple’

09-14-2018 06:31:17 PM - [RUN_DATA] - Logging run data ‘deviceOS’ with value ‘iOS’

09-14-2018 06:31:17 PM - [RUN_DATA] - Logging run data ‘deviceOSVersion’ with value ‘11.3’

09-14-2018 06:31:17 PM - [PASSED] - Started app at: ‘/Users/Afz/Documents/Build/6.0/SAMPLE_2.0.ipa’

09-14-2018 06:31:17 PM - [END] - End action : startApplication

09-14-2018 06:31:17 PM - [START] - Start action : tap

09-14-2018 06:31:17 PM - [INFO] - Finding Test Object with id ‘Object Repository/AAA/IOS/Logon/XCUIElementTypeButton - OK’

09-14-2018 06:31:17 PM - [INFO] - Checking object

09-14-2018 06:31:17 PM - [INFO] - Checking timeout

[XCUITest] Skipping setting of the initial display orientation. Set the “orientation” capability to either “LANDSCAPE” or “PORTRAIT”, if this is an undesired behavior.

[Appium] New XCUITestDriver session created successfully, session 28c052d5-4ced-4c1d-b9a3-118b30c46b05 added to master session list

[HTTP] <-- POST /wd/hub/session 200 20024 ms - 726

[HTTP]

[HTTP] --> GET /wd/hub/status

[HTTP] {}

[HTTP] <-- GET /wd/hub/status 200 32 ms - 55

[HTTP]

[HTTP] --> POST /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/timeouts

[HTTP] {“type”:“implicit”,“ms”:30000}

[HTTP] <-- POST /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/timeouts 400 15 ms - 4196

[HTTP]

[HTTP] --> GET /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/window/current/size

[HTTP] {}

[HTTP] <-- GET /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/window/current/size 200 114 ms - 99

[HTTP]

[HTTP] --> POST /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/elements

[HTTP] {“using”:“xpath”,“value”:"//XCUIElementTypeButton[@label = ‘OK’ and @name = ‘OK’]"}

[HTTP] <-- POST /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/elements 200 4267 ms - 124

[HTTP]

[HTTP] --> GET /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05

[HTTP] {}

[XCUITest] Merging WDA caps over Appium caps for session detail response

[HTTP] <-- GET /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05 200 1159 ms - 736

[HTTP]

[HTTP] --> GET /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05

[HTTP] {}

[XCUITest] Merging WDA caps over Appium caps for session detail response

[HTTP] <-- GET /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05 200 818 ms - 736

[HTTP]

[HTTP] --> GET /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05

[HTTP] {}

[XCUITest] Merging WDA caps over Appium caps for session detail response

[HTTP] <-- GET /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05 200 831 ms - 736

[HTTP]

[HTTP] --> GET /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05

[HTTP] {}

[XCUITest] Merging WDA caps over Appium caps for session detail response

[HTTP] <-- GET /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05 200 820 ms - 736

[HTTP]

[HTTP] --> GET /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/element/44000000-0000-0000-5F0D-000000000000/location

[HTTP] {}

[HTTP] <-- GET /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/element/44000000-0000-0000-5F0D-000000000000/location 200 160 ms - 89

[HTTP]

[HTTP] --> POST /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/touch/perform

[HTTP] {“actions”:[{“action”:“tap”,“options”:{“element”:“44000000-0000-0000-5F0D-000000000000”,“x”:1,“y”:1}}]}

09-14-2018 06:31:25 PM - [PASSED] - Tapped on element ‘Object Repository/AAA/IOS/Logon/XCUIElementTypeButton - OK’

09-14-2018 06:31:25 PM - [END] - End action : tap

09-14-2018 06:31:25 PM - [START] - Start action : setText

09-14-2018 06:31:25 PM - [INFO] - Finding Test Object with id ‘Object Repository/AAA/IOS/Logon/XCUIElementTypeSecureTextField - Enter mPIN’

09-14-2018 06:31:25 PM - [INFO] - Checking object

09-14-2018 06:31:25 PM - [INFO] - Checking timeout

[HTTP] <-- POST /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/touch/perform 200 210 ms - 74

[HTTP]

[HTTP] --> GET /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/window/current/size

[HTTP] {}

[HTTP] <-- GET /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/window/current/size 200 117 ms - 99

[HTTP]

[HTTP] --> POST /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/elements

[HTTP] {“using”:“xpath”,“value”:"//XCUIElementTypeSecureTextField"}

[HTTP] <-- POST /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/elements 200 3950 ms - 124

[HTTP]

[HTTP] --> GET /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05

[HTTP] {}

[XCUITest] Merging WDA caps over Appium caps for session detail response

[HTTP] <-- GET /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05 200 776 ms - 736

[HTTP]

[HTTP] --> GET /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05

[HTTP] {}

[XCUITest] Merging WDA caps over Appium caps for session detail response

[HTTP] <-- GET /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05 200 800 ms - 736

[HTTP]

[HTTP] --> GET /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05

[HTTP] {}

[XCUITest] Merging WDA caps over Appium caps for session detail response

[HTTP] <-- GET /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05 200 783 ms - 736

[HTTP]

[HTTP] --> GET /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05

[HTTP] {}

[XCUITest] Merging WDA caps over Appium caps for session detail response

[HTTP] <-- GET /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05 200 787 ms - 736

[HTTP]

[HTTP] --> GET /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/element/86000000-0000-0000-5F0D-000000000000/location

[HTTP] {}

[HTTP] <-- GET /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/element/86000000-0000-0000-5F0D-000000000000/location 200 152 ms - 89

[HTTP]

[HTTP] --> POST /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/element/86000000-0000-0000-5F0D-000000000000/clear

[HTTP] {“id”:“86000000-0000-0000-5F0D-000000000000”}

[HTTP] <-- POST /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/element/86000000-0000-0000-5F0D-000000000000/clear 200 153 ms - 76

[HTTP]

[HTTP] --> POST /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/element/86000000-0000-0000-5F0D-000000000000/value

[HTTP] {“id”:“86000000-0000-0000-5F0D-000000000000”,“value”:[“123456”]}

09-14-2018 06:31:35 PM - [PASSED] - Text ‘123456’ has been set to element ‘Object Repository/AAA/IOS/Logon/XCUIElementTypeSecureTextField - Enter mPIN’

09-14-2018 06:31:35 PM - [END] - End action : setText

09-14-2018 06:31:35 PM - [START] - Start action : waitForElementPresent

09-14-2018 06:31:35 PM - [INFO] - Finding Test Object with id ‘Object Repository/AAA/IOS/Logon/XCUIElementTypeButton - ic navicon 3bar’

09-14-2018 06:31:35 PM - [INFO] - Checking object

09-14-2018 06:31:35 PM - [INFO] - Checking timeout

[HTTP] <-- POST /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/element/86000000-0000-0000-5F0D-000000000000/value 200 1717 ms - 76

[HTTP]

[HTTP] --> GET /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/window/current/size

[HTTP] {}

[HTTP] <-- GET /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/window/current/size 200 140 ms - 99

[HTTP]

[HTTP] --> POST /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/elements

[HTTP] {“using”:“xpath”,“value”:"//XCUIElementTypeButton[@label = ‘ic navicon 3bar’ and @name = ‘ic navicon 3bar’]"}

09-14-2018 06:31:38 PM - [WARNING] - Object Object Repository/AAA/IOS/Logon/XCUIElementTypeButton - ic navicon 3bar not found

09-14-2018 06:31:38 PM - [END] - End action : waitForElementPresent

09-14-2018 06:31:38 PM - [START] - Start action : tap

09-14-2018 06:31:38 PM - [INFO] - Finding Test Object with id ‘Object Repository/AAA/IOS/Logon/XCUIElementTypeButton - ic navicon 3bar’

09-14-2018 06:31:38 PM - [INFO] - Checking object

09-14-2018 06:31:38 PM - [INFO] - Checking timeout

[HTTP] <-- POST /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/elements 200 2699 ms - 74

[HTTP]

[HTTP] --> GET /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/window/current/size

[HTTP] {}

[HTTP] <-- GET /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/window/current/size 200 56 ms - 99

[HTTP]

[HTTP] --> POST /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/elements

[HTTP] {“using”:“xpath”,“value”:"//XCUIElementTypeButton[@label = ‘ic navicon 3bar’ and @name = ‘ic navicon 3bar’]"}

[HTTP] <-- POST /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/elements 200 997 ms - 74

[HTTP]

[HTTP] --> POST /wd/hub/session/28c052d5-4ced-4c1d-b9a3-118b30c46b05/elements

[HTTP] {“using”:“xpath”,“value”:"//XCUIElementTypeButton[@label = ‘ic navicon 3bar’ and @name = ‘ic navicon 3bar’]"}

09-14-2018 06:31:40 PM - [FAILED] - Object Object Repository/AAA/IOS/Logon/XCUIElementTypeButton - ic navicon 3bar not found

09-14-2018 06:31:40 PM - [FAILED] - Failed to tap on element ‘Object Repository/AAA/IOS/Logon/XCUIElementTypeButton - ic navicon 3bar’ (Root cause: Object Object Repository/AAA/IOS/Logon/XCUIElementTypeButton - ic navicon 3bar not found)

09-14-2018 06:31:40 PM - [END] - End action : tap

09-14-2018 06:31:40 PM - [FAILED] - Test Cases/AAA/IOS/Logon/Login FAILED because (of) Failed to tap on element ‘Object Repository/AAA/IOS/Logon/XCUIElementTypeButton - ic navicon 3bar’ (Root cause: Object Object Repository/AAA/IOS/Logon/XCUIElementTypeButton - ic navicon 3bar not found)

09-14-2018 06:31:40 PM - [END] - End Test Case : Test Cases/AAA/IOS/Logon/Login