I’m testing a website in Chrome using Python, Appium, Android Emulator and trying to figure out how to stay logged in between multiple tests. The most common answer to similar questions I found is to add --user-data-dir option so I wrote the following:
options.add_argument(‘–user-data-dir=/data/data/com.android.chrome/app_chrome/Profile’)
According to chrome://version it changed profile path to /data/data/com.android.chrome/app_chrome/Profile/Default but still each time a driver instance is created that directory is restored to its default state.
Answering Appium - running browser tests without clearing browser data one person states that “Chromedriver always starts totally fresh, nothing is keeping” while another person from Using selenium: How to keep logged in after closing Driver in Python confirms that in case of OSX “it worked perfectly fine, I don’t need to login again”.
I also encountered Appium Reset Strategies and tried to add the following to desired capabilities with no luck:
desired_caps[‘noReset’] = ‘true’
desired_caps[‘fullReset’] = ‘false’