-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
need to remove autoLanch=false, launchApp(), closeApp(), and resetApp() #15807
Comments
👍 So, appium has no issue for WPA case as well after removing autoLaunch=false. On iOS, it is just a shortcut of safari on a home screen. It has no bundleid, so to automate it, a user should start a session with homescreen and find the icon, and click it. |
for autoLaunch: Is it good to remove the caps from https://github.com/appium/appium/blob/2.0/packages/base-driver/lib/basedriver/desired-caps.js#L23-L25 and add this in the migration guide...? other commands: Remove them from route.js or return errors first...? |
@KazuCocoa yes sounds like a good plan. as for the other commands, i think we should remove them from basedriver now, without any need for deprecation notice. that will be in the migration guide. then we can remove them from the drivers once the crossover to 2.0 is complete in 6 months or whenever. so if you're using 2.0 now with 2.0 basedriver, you won't have access, but with appium 1.x there will be access until the EOL period. |
I would argue against the removal of It seems to me that it is working perfectly fine and it is perfectly maintainable for Android. Correct me I'm wrong but the app state is clean, including things like local storage, sessions. Instead of removing Another thing: Creating sessions takes time and Using There's often a limit to concurrent sessions. If a user wishes to clean the app state while reusing the same session, for whatever reason, making tests atomic or to speed up test runs, they will be left without any options. Seems the devs are a bit disconnected from the reality of owning and maintaining an Appium test suite. I don't see enough of an argument to remove this functionality, even if it's for a major version. |
It does. Actually on iOS uninstalling an app is the only way to cleanup its data |
|
What is to be used as an alternative to resetApp() in situations where we want resets between tests within the same spec file? |
It depends on your scenario. |
So my scenario is closing and creating a new session each time. Just to clarify this is driver.quit() and driver.create()? Thanks! |
This will depend on the client you are using. What @KazuCocoa is saying is that you can just quit and start a new session. You are already doing this. If you want to do it multiple times within one test you might need to rearchitect your test suite so that it happens internally rather than on setup/teardown of each test. That's all up to you; your test architecture is not related to Appium. |
So yea currently we do do that interally, but the actual code which resets the app is the driver.reset(). What I'm asking is what should we migrate to when that's gone? Using WDIO, XCUI and UIAutomator2 currently |
Then, uninstall the app -> install the app -> launch the app should be enough. |
@KazuCocoa is there a way to maintain the state of application when performing the above operation. I tried with full reset = false and no reset = true but could not get |
Do you mean via https://appium.io/docs/en/commands/device/app/app-state/ ? |
I understand the issue regarding session management and this does seem like a better approach, however, I have a use case for In my Android + iOS native app test suites, devs use the following setup:
If Is this not a valid use case to keep |
@jlipps @KazuCocoa, Should I remove the ResetApp from the dotnet-client or not? |
Eventually yes. Some clients may show deprecation warning. appium/dotnet-client#562 is for the dotnet client. |
Yes, I'm aware of that open issue. just I saw some questions whether to keep that one or not. |
also
|
Hi, just a short note about my Appium expirence using real Android devices:
Or is there another way to close (bring in background) the app at test end using java client 8.x on real device? Regards |
@Portium Try shouldTerminateApp capability if you are talking about UIA2 driver |
For now the deprecation is done for all major driver but UIA2 |
There's still no clear instruction on how to replace the driver.resetApp() command when only bundleID is used (.i.e. the app does not get removed and reinstalled before each test; 'bundleId' capability is used instead of 'app'. |
yes, terminate/activate is ok for the process restart generally. In case you wanted to clear the local data, you might need to uninstall the app once as iOS. I made some suggestions at the top of this issue #15807 (comment) |
hey guys, was navigating through google searches for my problem and i stumbled across this thread. i'll keep it short; i'm doing some test automation for a hybrid app (based on both Android & iOS) through appium 2.1 with python and python client, on macOS Ventura. a little piece of my struggles led me here which is, 'cleaning the cache/resetting the state' of the app on the iOS platform after each test script/case. initially what i've understood from reading this thread, there is no way of doing said task except removing the app and installing it again. but then again, we're on v2.1 of appium, there might've been a way that i've missed. need some guidance regarding this issue. Also, i'm making a hybrid automation test suite. meaning, same test script, but will run on iOS or Android depending on whichever platform is detected at the start of the script. PS. |
Look to this capabilities
In this case.
If I remove |
@fleytman for checking installation I would probably run |
Perhaps Then, starting a new session without app/bundle Id and autoLaunch create a session with do nothing. Then, the session calls |
Yes, there are ways to implement it yourself, although not very obvious (there is no P.S. I want to make sure that when I make changes to the appium code I don't lose the functionality that is there. In this case it looks like the case I mentioned with enforceAppInstall was not taken into account. But the very situation with the refusal of capabilities requires a lot of changes in the code of current projects, so much so that there are discussions whether it is worth switching to the latest versions of appium at all... |
This suite of functionality is outdated and confusing and dangerous. We should remove the routes and driver implementations for these. In their place, users should rely on standard Appium session management (new session + caps, delete session), and the now-reliable app management functions (terminateApp, installApp, activateApp, startActivity, etc...)
[update by Kazu]
Alternative
mobile: terminateApp
,mobile: activateApp
,mobile: launchApp
,mobile: startActivity
mobile: clearApp
could help -> https://appium.github.io/appium-xcuitest-driver/latest/execute-methods/#mobile-clearappThe text was updated successfully, but these errors were encountered: