0

I'm testing a web application on Chrome, Android (real device, not emulator) using Appium. Whenever I launch a test, all browser data (bookmarks, history etc.) is deleted. Is there any way to stop this from happening?

I tried setting the noReset capability to true, but that didn't help.

Thank you in advance for any help

public static Uri testServerAddress = new Uri("http://127.0.01:4723/wd/hub"); // Appium is running locally
    public static TimeSpan INIT_TIMEOUT_SEC = TimeSpan.FromSeconds(180);

public void SetUpTest()
    {
        if (driver == null)
        {
            DesiredCapabilities testCapabilities = new DesiredCapabilities();
            testCapabilities.SetCapability("browserName", "Chrome");
            testCapabilities.SetCapability("platformName", "Android");
            testCapabilities.SetCapability("deviceName", "S(Galaxy S5)");
            testCapabilities.SetCapability("noReset", true);

            AppUrl = "http://www.google.com/"; //for example
            driver = new RemoteWebDriver(testServerAddress, testCapabilities, INIT_TIMEOUT_SEC);                
            driver.Manage().Timeouts().ImplicitlyWait(new TimeSpan(0, 0, globalTimeoutInSec));
            driver.Navigate().GoToUrl(AppUrl);
        }
    }
user3670127
  • 25
  • 2
  • 9

1 Answers1

1

Chromedriver always starts totally fresh, nothing is keeping. There is option to re-use the existent one (using desired capability androidUseRunningApp) but unfortunately Appium any way will kill it.

Please see more details in this post

Eugene
  • 1,865
  • 3
  • 21
  • 24
  • I don't think this answers the question, at least not my understanding of it. I have the same issue, given: I am using my personal Android phone to test/learn appium. I use chrome (personally) and save some bookmarks. When: I use my phone for an appium test, Then: it wipes out all of my personal bookmarks. So, is there a way to prevent this? Is there anything for chrome/android similar to firefox/linux profiles? then I could use a "test-profile" on android that wouldn't kill my personal data. thx – mancocapac Nov 30 '16 at 21:52