Skip to content

Instantly share code, notes, and snippets.

@unclebean
Created January 6, 2015 23:34
Show Gist options
  • Save unclebean/35ee964c7c3b2e55e7dd to your computer and use it in GitHub Desktop.
Save unclebean/35ee964c7c3b2e55e7dd to your computer and use it in GitHub Desktop.
appium python template
"""
More python client refer to https://github.com/appium/python-client
"""
import unittest
import os
from random import randint
from appium import webdriver
from time import sleep
class SimpleIOSTests(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Remote(
command_executor='http://127.0.0.1:4723/wd/hub',
desired_capabilities={
'platformName': 'iOS',
'platformVersion': '8.1',
'deviceName': 'iPad'
})
def tearDown(self):
self.driver.quit()
def test_allEls(self):
els = self.driver.find_elements_by_class_name('UIAButton')
sleep(100)
if __name__ == '__main__':
suite = unittest.TestLoader().loadTestsFromTestCase(SimpleIOSTests)
unittest.TextTestRunner(verbosity=2).run(suite)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment