Skip to content

Instantly share code, notes, and snippets.

@bbchriscesar
Created December 3, 2018 20:11
Show Gist options
  • Select an option

  • Save bbchriscesar/febc5035f6fb7d8c5909b0de101d1399 to your computer and use it in GitHub Desktop.

Select an option

Save bbchriscesar/febc5035f6fb7d8c5909b0de101d1399 to your computer and use it in GitHub Desktop.
from appium import webdriver
from appium.webdriver.common.touch_action import TouchAction
import time
import os.path
locales = ['en', ' ja', 'de']
slash = '/'
for locale in locales:
directory = '/Users/christiannec/Documents/Demo/' + locale
if not os.path.exists(directory):
os.makedirs(directory)
desired_capabilities = {}
desired_capabilities['language'] = locale
desired_capabilities['automationName'] = 'XCUITest'
desired_capabilities['platformName'] = 'iOS'
desired_capabilities['platformVersion'] = '12.1'
desired_capabilities['deviceName'] = 'iPhone X'
desired_capabilities['updatedWDABundleId'] = 'io.appium.WebDriverAgentRunnerScreenshot'
desired_capabilities['udid'] = '03e31c51fa1e678ba5c2433929d7d84c69a3d433'
desired_capabilities['showXcodeLog'] = 'true'
desired_capabilities['xcodeOrgId'] = 'TLZG6YM7ZM'
desired_capabilities['xcodeSigningId'] = 'iPhone Developer'
desired_capabilities['noReset'] = 'true'
desired_capabilities['bundleId'] = 'com.google.Stella.enterprise'
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_capabilities)
time.sleep(4)
driver.save_screenshot(directory + slash + 'iOS001.png')
TouchAction(driver).tap(x=111, y=748).perform()
time.sleep(2)
driver.save_screenshot(directory + slash + 'iOS002.png')
TouchAction(driver).tap(x=261, y=748).perform()
time.sleep(2)
driver.save_screenshot(directory + slash + 'iOS003.png')
TouchAction(driver).tap(x=277, y=122).perform()
time.sleep(2)
driver.save_screenshot(directory + slash + 'iOS004.png')
TouchAction(driver).tap(x=90, y=121).perform()
time.sleep(2)
driver.save_screenshot(directory + slash + 'iOS005.png')
TouchAction(driver).tap(x=336, y=748).perform()
time.sleep(2)
driver.save_screenshot(directory + slash + 'iOS006.png')
TouchAction(driver).tap(x=282, y=217).perform()
time.sleep(2)
driver.save_screenshot(directory + slash + 'iOS007.png')
TouchAction(driver).tap(x=36, y=748).perform()
time.sleep(2)
driver.save_screenshot(directory + slash + 'iOS008.png')
TouchAction(driver).tap(x=29, y=72).perform()
time.sleep(2)
driver.save_screenshot(directory + slash + 'iOS009.png')
TouchAction(driver).tap(x=354, y=406).perform()
time.sleep(2)
driver.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment