What is the difference? When I specify fullReset=true and noReset=false capabilities my app gets installed when I instantiate the driver, but then a closeApp call closes the simulator, restarts it, and REINSTALLS the app!
When I specify fullReset=true and noReset=true the app DOES NOT get installed when I instantiate the driver.
Note that in all cases I do not provide any “resetting” options when starting the server. The only one I use that MAY have an effect is --session-override
I need the following:
Instantiating the driver installs the app
The freedom to at any time close and re-open the app WITHOUT re-installing the app
Please, how can I do that? If anyone else is doing that (and I suspect there are thousands of you) I would love to see how you do it, step-by step, in desired capabilities and when starting the server
Still, what is the difference between fullReset and noReset, The names of these methods are beyond confusing, so can someone please tell me what these are supposed to do?
noReset just clears the app data, such as its cache.
fullRest uninstalls the app. fullReset is generally used when you have newer versions of the app coming in fairly quickly. So with fullReset, you will always uninstall the app and then automatically install the new version.
I want to clear my app(IOS) cache so I provided the below capabilities:
i tried:
cap.setCapability(MobileCapabilityType.NO_RESET, “false”);
cap.setCapability(MobileCapabilityType.FULL_RESET,“false”);
But it’s not clearing the cache, I am trying below case:
Steps:
I am starting my test script 1st time,adding item to cart next step is login and then checkout and then driver.quit()
Now am starting my same script 2nd time, it’s skipping the login step
add to cart and then checkout is coming directly because as I already logged in 1st time in the the app, Now 2nd time also I want same steps as I did 1st time that is add to cart login checkout and then driver.quit()
but 2nd time its doing add to cart checkout, but not going to login
@Sanjay_Sharma there are some problematic settings that do not delete and appium deleting app data in simulator (maybe phone also - just never tried) . and we need to use “fullReset” example.
for example with our client some settings got deleted but some are remain. so i divided tests into 3 main parts:
need fullRest (minor part of tests - 9 now). slow test start up to 1min depending on client size also.
fastReset (about 15-20 tests). faster start time
noReset (all other most of tests). fastest start time of 10sec about with mine machine.
I am also facing similar type of problem. My android capabilities are:
config.capabilities = [
{
platformName: ‘Android’,
noReset: false, // on Android will keep your app cache saved and with new Appium session there will be no need to log in again.
fullReset: true, // uninstall the app after test
maxInstances: 1,
automationName: ‘uiautomator2’,
deviceName: AndroidInfo.deviceName(),
platformVersion: AndroidInfo.platFormVersion(),
app: AndroidInfo.appName(),
chromedriverExecutable: ‘/integration-tests/node_modules/chromedriver/lib/chromedriver/chromedriver’,
},
];
When: noReset: false, fullReset: true: It clears the cache and UNINSTALL the app. noReset: true, fullReset: false: It does not clear the cache properly and for me this combination is not working as expected in automation. noReset: true, fullReset: true: It failed to create the session for me so in turn it failed for me. noReset: false, fullReset: false: It does not clear the cache + it does not UNINSTALL the app.
In my case, I want to clear the cache WITHOUT uninstalling the app. I would like my application to logout after my testCase execution is finished, thus clearing the cache as well.
When I user driver.resetApp(), it throws me below error:
[0-4] 2022-05-10T11:07:57.419Z INFO webdriver: COMMAND resetApp()
[0-4] 2022-05-10T11:07:57.419Z INFO webdriver: [POST] http://localhost:4723/session/a2ee94c9-de0f-4c1a-a58c-4baf1ed93ed8/appium/app/resetApp
[0-4] 2022-05-10T11:07:57.427Z DEBUG webdriver: request failed due to status 9
[0-4] 2022-05-10T11:07:57.427Z INFO webdriver: Retrying 1/3
[0-4] 2022-05-10T11:07:57.427Z WARN webdriver: Request failed with status 404 due to The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
[0-4] 2022-05-10T11:07:57.427Z INFO webdriver: [POST] http://localhost:4723/session/a2ee94c9-de0f-4c1a-a58c-4baf1ed93ed8/appium/app/resetApp
[0-4] 2022-05-10T11:07:57.432Z DEBUG webdriver: request failed due to status 9
[0-4] 2022-05-10T11:07:57.432Z INFO webdriver: Retrying 2/3
[0-4] 2022-05-10T11:07:57.432Z INFO webdriver: [POST] http://localhost:4723/session/a2ee94c9-de0f-4c1a-a58c-4baf1ed93ed8/appium/app/resetApp
[0-4] 2022-05-10T11:07:57.432Z WARN webdriver: Request failed with status 404 due to The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
[0-4] 2022-05-10T11:07:57.434Z DEBUG webdriver: request failed due to status 9
[0-4] 2022-05-10T11:07:57.434Z INFO webdriver: Retrying 3/3
[0-4] 2022-05-10T11:07:57.434Z INFO webdriver: [POST] http://localhost:4723/session/a2ee94c9-de0f-4c1a-a58c-4baf1ed93ed8/appium/app/resetApp
[0-4] 2022-05-10T11:07:57.434Z WARN webdriver: Request failed with status 404 due to The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
[0-4] 2022-05-10T11:07:57.436Z DEBUG webdriver: request failed due to status 9
[0-4] 2022-05-10T11:07:57.436Z ERROR webdriver: Request failed with status 404 due to unknown command: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
[0-4] Error in "0: When I click on "Log in to Gelato" button"
unknown command: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
at async World.<anonymous> (/Users/harsha.sharmagelato.com/Dev/work/sandbox/gelato-api-mobile/integration-tests/src/stepDefinitions/login.ts:21:5)
[0-4] 2022-05-10T11:07:57.438Z INFO webdriver: COMMAND deleteSession()
[0-4] 2022-05-10T11:07:57.438Z INFO webdriver: [DELETE] http://localhost:4723/session/a2ee94c9-de0f-4c1a-a58c-4baf1ed93ed8
2022-05-10T11:07:57.668Z DEBUG @wdio/local-runner: Runner 0-4 finished with exit code 1
[0-4] FAILED in /Users/harsha.sharmagelato.com/Dev/work/sandbox/gelato-api-mobile/build/app/outputs/flutter-apk/app-stage-debug.apk - /test/features/login.feature
2022-05-10T11:07:57.668Z INFO @wdio/cli:launcher: Run onWorkerEnd hook
2022-05-10T11:07:57.668Z DEBUG @wdio/cli:utils: Finished to run "onWorkerEnd" hook in 0ms
2022-05-10T11:07:57.668Z INFO @wdio/cli:launcher: Run onComplete hook
2022-05-10T11:07:57.668Z DEBUG @wdio/appium-service: Appium (pid: 50252) killed
2022-05-10T11:07:57.668Z DEBUG @wdio/cli:utils: Finished to run "onComplete" hook in 0ms
Spec Files: 0 passed, 1 failed, 4 skipped, 5 total (100% completed) in 00:00:35
2022-05-10T11:07:57.669Z INFO @wdio/local-runner: Shutting down spawned worker
2022-05-10T11:07:57.921Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
2022-05-10T11:07:57.922Z INFO @wdio/local-runner: shutting down
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] android: `wdio ./config/android.config.ts`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] android script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/harsha.sharmagelato.com/.npm/_logs/2022-05-10T11_07_57_941Z-debug.log
~/Dev/work/sandbox/gelato-api-mobile/integration-tests #