1

I'm using Appium to test my website on Chrome for Android. I would like to add some options to Chrome for Android such as the incognito mode and the possibility to disable the cache. I tried with the following sample code but it doesn't work properly. Appium is able to open Chrome on my Android device, but it isn't in incognito mode and hence it doesn't disable the browser's cache.

Here there is the code snippet of my Python script:

import appium
from time import sleep

desired_caps = {
    'platformName' : 'Android',
    'platformVersion' : '7.1.1',
    'deviceName' : 'ZX1G423BZQ',
    'browserName' : 'Chrome',
    'chromeOptions': {'args':['--incognito', '--disable-cache']}
}

driver = appium.webdriver.Remote("http://127.0.0.1:4723/wd/hub", desired_caps)
driver.get("http://www.google.com")

timings = driver.execute_script('return performance.timing')
print(timings)

driver.quit();

My environment is as follow:

  • Mac OS X 10.12
  • Android 7.1.1
  • Appium 1.6.4 (the dmg package)
  • Python 3.6 and the Python wrapper to Appium
  • Chrome v. 61.0.3163.98

I'm not sure what my mistake is here. Maybe, I'm not using the chromeOptions argument properly, but I didn't find the right way to exploit it.

antedesk
  • 756
  • 6
  • 15
  • 30

1 Answers1

2

The capabilities to set incognito/Private mode are not supported for mobile device driver instances in Appium Selenium

Kireeti Annamaraj
  • 1,037
  • 1
  • 8
  • 12
  • do you have some references to read? I'd like to properly understand the reason. Thank you – antedesk Jan 12 '18 at 09:24
  • 1
    Hi, Below documentation will help you figure out the Appium specific capabilities and Android (Google Chrome) specific capabilities. Any other capabilities, arguments, preferences or flags set other than the ones mentioned in the docs will not be applicable in the driver instance. https://appium.io/docs/en/writing-running-appium/caps/ https://sites.google.com/a/chromium.org/chromedriver/getting-started/getting-started---android – Kireeti Annamaraj Jan 12 '18 at 12:21
  • thank you! I'll go through them to properly understand what I can do :) – antedesk Jan 13 '18 at 14:06