Appium运行脚本初始化数据

class MyTestCase(unittest.TestCase):
    def setUp(self):
        desired_caps = {} #以下是初始化数据
        desired_caps['platformName'] = 'Android'
        desired_caps['platformVersion'] = '5.1'
        desired_caps['deviceName'] = 'Android Emulator'
        desired_caps['appPackage'] = 'com.android.calculator2'
        desired_caps['appActivity'] = '.Calculator'
        desired_caps["unicodeKeyboard"] = "True" #设置输入发
        desired_caps["resetKeyboard"] = "True" #恢复原来的输入法
        self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)

    def test_something(self):
        pass

    def tearDown(self):
        self.driver.quit()


if __name__ == '__main__':
    unittest.main()

 

posted on 2017-04-18 23:08  miss_林  阅读(174)  评论(0编辑  收藏  举报

导航