def setUp(self):
     """
         execute 'xcodebuild -project example.xcodeproj -sdk iPhoneSimulator' first
         Then it will generate a *.app file at build/Release-iphonesimulator/
     """
     desired_caps = desired_capabilities.get_desired_capabilities("Demo3.zip")
     self.driver = webdriver.Remote("http://localhost:4723/wd/hub", desired_caps)
示例#2
0
 def create_driver(self):
     PrepActivities.driver = webdriver.Remote('http://localhost:4723/wd/hub',
                                              desired_capabilities.get_desired_capabilities('andriod-debug.apk'))
     # time.sleep(20)
     PrepActivities.driver.implicitly_wait(40)
     print "after sleep.. app should open.."
     return PrepActivities.driver
示例#3
0
 def test_press_button(self):
     self.driver.press_button("Home")
     if float(desired_capabilities.get_desired_capabilities(
             desired_capabilities.BUNDLE_ID)['platformVersion']) < 11:
         return
     self.assertEqual(self.driver.query_app_state(desired_capabilities.BUNDLE_ID),
                      ApplicationState.RUNNING_IN_FOREGROUND)
    def setUp(self):
        desired_caps = desired_capabilities.get_desired_capabilities('ApiDemos-debug.apk')
        self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)

        # relax template matching
        self.driver.update_settings({"fixImageFindScreenshotDims": False,
                                     "fixImageTemplateSize": True,
                                     "autoUpdateImageElementPosition": True})
    def getAndroidDriverInfo(self):
        '''  定义获取driver属性信息的函数--安卓     '''

        desired_caps = desired_capabilities.get_desired_capabilities('SeceMail/secemail.apk')

        driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
        print '\n for test',driver,'\n'
        return driver
示例#6
0
	def setUp(self):
		desired_caps=desired_capabilities.get_desired_capabilities()
		uri=desired_capabilities.get_uri()
		self.driver=webdriver.Remote(uri,desired_caps)
		self.driver.implicitly_wait(2)
		self.driver.find_element(By.XPATH,"//android.widget.LinearLayout/android.widget.EditText[1]").send_keys('wbin')
		self.driver.find_element(By.XPATH,"//android.widget.LinearLayout/android.widget.EditText[2]").send_keys('123456')
		self.driver.find_element(By.ID,"com.quickfix057.kuaixiustaff_test:id/btn_login").click()
		self.driver.implicitly_wait(2)
示例#7
0
    def setUp(self):
        desired_caps = desired_capabilities.get_desired_capabilities()
        uri = desired_capabilities.get_uri()
        self.driver = webdriver.Remote(uri, desired_caps)
        sleep(10);
        window_size  = self.driver.get_window_size();
	width = 720
	height = 1280
        self.ratioX = float("%.2f" % (float(window_size["width"]) / float(width)));
        self.ratioY = float("%.2f" % (float(window_size["height"]) / float(height)));
示例#8
0
	def setUp(self):
		desired_caps=desired_capabilities.get_desired_capabilities()
		uri=desired_capabilities.get_uri()
		self.driver=webdriver.Remote(uri,desired_caps)
		time.sleep(2)
		m=self.driver.find_elements(By.CLASS_NAME, value="android.widget.EditText")
		m[0].send_keys('wbin')
		m[1].send_keys('123456')
		self.driver.find_element(By.ID,"com.quickfix057.kuaixiustaff_test:id/btn_login").click()
		time.sleep(4)
示例#9
0
    def setUp(self):
        # desired_caps = {}
        # desired_caps['platformName'] = 'iOS'
        # desired_caps['platformVersion'] = '9.0'
        # desired_caps['deviceName'] = 'iPhone 6s'
        # desired_caps['app'] = '/Users/chenchenzheng/github/appium/python-client/test/apps/UICatalog.app.zip'
        # desired_caps['noReset'] = 'false'


        desired_caps = desired_capabilities.get_desired_capabilities('whistler.app')

        self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
示例#10
0
 def test_app_management(self):
     # this only works in Xcode9+
     if float(desired_capabilities.get_desired_capabilities(
             desired_capabilities.BUNDLE_ID)['platformVersion']) < 11:
         return
     self.assertEqual(self.driver.query_app_state(desired_capabilities.BUNDLE_ID),
                      ApplicationState.RUNNING_IN_FOREGROUND)
     self.driver.background_app(-1)
     self.assertTrue(self.driver.query_app_state(desired_capabilities.BUNDLE_ID) <
                     ApplicationState.RUNNING_IN_FOREGROUND)
     self.driver.activate_app(desired_capabilities.BUNDLE_ID)
     self.assertEqual(self.driver.query_app_state(desired_capabilities.BUNDLE_ID),
                      ApplicationState.RUNNING_IN_FOREGROUND)
    def setUp(self):
        desired_caps = desired_capabilities.get_desired_capabilities('')
        desired_caps['appActivity'] = '.main.MainActivityNew'
        desired_caps['appPackage'] = 'com.htinns'
        self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
        self.driver.implicitly_wait(10)
        # 测试数据初始化
        self.user_account = '15618385153'
        self.user_password = '******'
        self.user_name = u'倪伟'

        print u"开始测试"

        # 若用户已登录,先退出.然后返回首页
        self.driver.find_element_by_id('com.htinns:id/linMe').click()
        try:
            self.assertTrue(self.driver.find_element_by_id('com.htinns:id/user_name').is_displayed())
        except:
            self.driver.find_element_by_id('com.htinns:id/linMain').click()
        else:
            self.driver.find_element_by_id('com.htinns:id/btnSet').click()
            self.driver.find_element_by_id('com.htinns:id/btnLogin').click()
            self.driver.find_element_by_id('com.htinns:id/linMain').click()
示例#12
0
 def setUp(self):
     desired_caps = desired_capabilities.get_desired_capabilities('eqxiu-2.2.2.0007.apk')
     self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
示例#13
0
 def setUp(self):
     desired_caps = desired_capabilities.get_desired_capabilities('')
     desired_caps['appActivity'] = '.main.MainActivityNew'
     desired_caps['appPackage'] = 'com.htinns'
     self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
     print u"开始测试"
示例#14
0
 def setUpClass(self):
     self.desired_caps = desired_capabilities.get_desired_capabilities('TestApp.app.zip')
     self.driver = webdriver.Remote('http://localhost:4723/wd/hub', self.desired_caps) 
示例#15
0
	def setUp(self):
		desired_caps=desired_capabilities.get_desired_capabilities()
		uri=desired_capabilities.get_uri()
		self.driver=webdriver.Remote(uri,desired_caps)
		time.sleep(3)
 def setUp(self):
     desired_caps = desired_capabilities.get_desired_capabilities('')
     desired_caps['appActivity'] = '.Calculator'
     desired_caps['appPackage'] = 'com.android.calculator2'
     self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
     print u"开始测试"
 def setUp(self):
     desired_caps = desired_capabilities.get_desired_capabilities(
         'ApiDemos-debug.apk')
     desired_caps['automationName'] = 'Selendroid'
     self.driver = webdriver.Remote('http://localhost:4723/wd/hub',
                                    desired_caps)
示例#18
0
 def setUp(self):
     desired_caps = desired_capabilities.get_desired_capabilities('UICatalog.app.zip')
     self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
示例#19
0
 def setUp(self):
     desired_caps = desired_capabilities.get_desired_capabilities('ApiDemos-debug.apk')
     desired_caps['automationName'] = 'Selendroid'
     self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
示例#20
0
 def setUp(self):
     desired_caps = desired_capabilities.get_desired_capabilities('ApiDemos-debug.apk')
     self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
示例#21
0
 def setUp(self):
     desired_caps = desired_capabilities.get_desired_capabilities(
         'ApiDemos-debug.apk')
     self.driver = webdriver.Remote('http://localhost:4723/wd/hub',
                                    desired_caps)
示例#22
0
 def setUp(self):
     desired_caps = desired_capabilities.get_desired_capabilities(
         'selendroid-test-app.apk')
     self.driver = webdriver.Remote('http://localhost:4723/wd/hub',
                                    desired_caps)
 def setUp(self):
     desired_caps = desired_capabilities.get_desired_capabilities('selendroid-test-app.apk')
     self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
示例#24
0
 def setUp(self):
     desired_caps = desired_capabilities.get_desired_capabilities(self.param['deviceName'])
     self.driver = webdriver.Remote('http://localhost:'+self.param['port']+'/wd/hub', desired_caps)
示例#25
0
 def setUp(self):
     desired_caps = desired_capabilities.get_desired_capabilities('UICatalog.app.zip')
     self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
示例#26
0
 def setUp(self):
     desired_caps = desired_capabilities.get_desired_capabilities('192.168.0.203:5555')
     self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)