【问题标题】:Appium - running browser tests without clearing browser dataAppium - 在不清除浏览器数据的情况下运行浏览器测试
【发布时间】:2015-07-08 12:49:04
【问题描述】:

我正在使用 Appium 在 Chrome、Android(真实设备,而不是模拟器)上测试 Web 应用程序。每当我启动测试时,所有浏览器数据(书签、历史记录等)都会被删除。有没有办法阻止这种情况发生?

我尝试将 noReset 功能设置为 true,但这没有帮助。

提前感谢您的帮助

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);
        }
    }

【问题讨论】:

  • 您在移动设备上进行测试吗?
  • 哦,对了,忘了补充:我在安卓手机(Galaxy S5)上测试
  • 你能贴出你做过的代码吗?分享有问题的代码?
  • 将测试设置代码添加到问题中
  • 看起来不错,但我认为 selenium 总是启动新会话,因此它会清除所有内容。

标签: google-chrome testing selenium automated-tests appium


【解决方案1】:

Chromedriver 总是以全新的方式开始,没有任何东西保留。 可以选择重新使用现有的(使用所需的功能 androidUseRunningApp),但不幸的是 Appium 任何方式都会杀死它。

更多详情请查看post

【讨论】:

  • 我不认为这回答了这个问题,至少不是我对它的理解。鉴于我有同样的问题:我正在使用我的个人 Android 手机来测试/学习 appium。我(个人)使用 chrome 并保存一些书签。时间:我用手机进行 appium 测试,然后:它清除了我所有的个人书签。那么,有没有办法防止这种情况发生呢? chrome/android 有什么类似于 firefox/linux 配置文件的吗?然后我可以在不会杀死我的个人数据的 android 上使用“测试配置文件”。谢谢
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-07-06
  • 2021-01-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多