• 0

Automate chrome apps

Chrome apps written using webview are different than iFrames because webview is a separate process. With Selenium 2.20 it is possible to automate chrome apps written using webview.

driver = webdriver.Chrome(desired_capabilities={'chromeOptions':{'windowTypes':['webview']}})

driver.get('chrome://apps')

wait_for_new_window_to_appear()

driver.switch_to.window(driver.window_handles[1])

self.driver.find_element_by_id('Email').send_keys('[email protected]')

driver.find_element_by_id('Passwd').send_keys(getpass.getpass())

driver.find_element_by_id('signIn').click()

References :

  • https://bugs.chromium.org/p/chromedriver/issues/detail?id=960

  • http://stackoverflow.com/questions/21022837/how-to-automate-testing-of-chrome-packaged-apps