I am testing an Android application at work and we use Appium to do so. Our tests are written in such a way that the @BeforeMethod setUp() method is run every time before each test method. We separate them in classes, so that each class usually has 3-4 methods inside. The setUp() method then reinstalls the app on the device every single test through the caps.setCapability(), which in turn takes a lot of time.
My question is simple, is there a way to run a setUp() method only once before each test run, so that it would’t have to reinstall the app every single time? Or is it a core Appium requirement to do so? If so, can we make a feature request to change that somehow?
I am glad that worked for you
If you will decide to reset app at some point here are the steps:
uninstall app using adb/ideviceinstaller
initiate new driver with the same capabilities
P.S. On Android you can reset app by clearing app data using adb command: adb -u UDID shell pm clear PACKAGE. That’s much faster than uninstalling and installing app.
I have been struggling with this problem for a long time. When I navigate to a web page and click on a web element then no errors occur, it looks like it was successful but on physical Android mobile