Two applications are in play here – one for customers and the other for pickers. After a customer submits an order, the picker app should get a notification. Once approved, the status of the customer's order will change. I am attempting to automate this process, but I am facing issues running both apps simultaneously on separate emulators.
When I run the apps, they open on a single emulator and fail consecutively without respecting the order in which they should launch. Additionally, the apps should not open on the same emulator. Moreover, I encountered the following error:
`in "0: Given A user is on the toters app home tab"invalid session id: The session identified by 6bb7ce21-dcdd-49ee-b5b3-bd9b56abb8a1 is not knownat getErrorFromResponseBody (file:///C:/Users/Toters/Desktop/toters-automated-tests/node_modules/webdriver/build/utils.js:195:12)at NodeJSRequest._request (file:///C:/Users/Toters/Desktop/toters-automated-tests/node_modules/webdriver/build/request/index.js:193:23)at processTicksAndRejections (node:internal/process/task_queues:95:5)at async Browser.wrapCommandFn (file:///C:/Users/Toters/Desktop/toters-automated-tests/node_modules/@wdio/utils/build/shim.js:90:29)at async Browser.$ (file:///C:/Users/Toters/Desktop/toters-automated-tests/node_modules/webdriverio/build/commands/browser/$.js:74:17)at async Browser.wrapCommandFn (file:///C:/Users/Toters/Desktop/toters-automated-tests/node_modules/@wdio/utils/build/shim.js:90:29)at async Common.accessHomePage (file:///C:/Users/Toters/Desktop/toters-automated-tests/features/pageobjects/mobile/android/common/common.ts:29:18)at async World.<anonymous> (file:///C:/Users/Toters/Desktop/toters-automated-tests/features/step-definitions/mobile/android/dark-store/order.ts:10:5)at async wrapPromiseWithTimeout (C:\Users\Toters\Desktop\toters-automated-tests\node_modules@cucumber\cucumber\src\time.ts:55:10)at async Object.run (C:\Users\Toters\Desktop\toters-automated-tests\node_modules@cucumber\cucumber\src\user_code_runner.ts:86:16)[0-0] 2024-05-02T16:01:33.285Z INFO webdriver: COMMAND deleteSession()[0-0] 2024-05-02T16:01:33.285Z INFO webdriver: COMMAND deleteSession()[0-0] 2024-05-02T16:01:33.286Z INFO webdriver: [DELETE] http://0.0.0.0:4723/session/9bf0b941-f990-41bb-804e-afca003d57fe[0-0] 2024-05-02T16:01:33.286Z INFO webdriver: [DELETE] http://0.0.0.0:4723/session/de7d06d8-b0e7-4752-9021-ecd7dd50ebee[0-0] 2024-05-02T16:01:33.786Z INFO webdriver: RESULT null[0-0] 2024-05-02T16:01:33.863Z INFO webdriver: RESULT null[0-0] FAILED in MultiRemote - file:///C:/Users/Toters/Desktop/toters-automated-tests/features/features/mobile/dark-store/place.order.feature2024-05-02T16:01:33.987Z INFO @wdio/cli:launcher: Run onWorkerEnd hook2024-05-02T16:01:33.987Z INFO @wdio/cli:launcher: Run onComplete hook
I have two Android emulators up and running:
customer-app, picker-app
I have executed the appium command in my terminal to boot the appium server on port 4723
Ports 4728 and 4729 are available for use.
The android.conf.ts file contains the following capabilities:
capabilities: {
customerApp: {
capabilities: {
platformName: "Android",
"appium:app":
"/Users/Toters/Desktop/toters-automated-tests/apps/app-staging-debug.apk",
"appium:platformVersion": "11",
"appium:deviceName": "customer-app",
"appium:automationName": "UIAutomator2",
"appium:systemPort": 4728,
},
},
pickerApp: {
capabilities: {
platformName: "Android",
"appium:app":
"/Users/Toters/Desktop/toters-automated-tests/apps/picker-staging-build.apk",
"appium:platformVersion": "11",
"appium:deviceName": "picker-app",
"appium:automationName": "UIAutomator2",
"appium:systemPort": 4729,
},
},
},
In addition, changes have been made to the index.d.ts and types.d.ts files to incorporate the capabilities globally and within the multiRemoteBrowser respectively.
A common.ts file has been created to house the code and includes a function to initialize both devices.
const { customerApp, pickerApp } = multiremotebrowser;
async accessHomePage() {
while (
!(await customerApp
.$("[resource-id = 'com.toters.customer.staging:id/btnGetStarted']")
.isExisting())
) {
console.log("waiting for get started button to appear");
}
while (
!(await pickerApp
.$("[resource-id = 'com.toters.customer.staging:id/btnGetStarted']")
.isExisting())
) {
console.log("waiting for get started button to appear");
}
}