Esempio n. 1
0
 def setUp(self):
     # 获取我们设定的capabilities,通知Appium Server创建相应的会话。
     self.desired_caps = desired_capabilities.get_desired_capabilities()
     # 获取server的地址。
     self.uri = desired_capabilities.get_uri()
     self.timeout = 30
     # 获取用户名和密码
     self.user = desired_capabilities.getParam("username")
     self.passwd = desired_capabilities.getParam("password")
     print "登录用户%s" % self.user
     self.driver = webdriver.Remote(self.uri, self.desired_caps)
     self.driver.implicitly_wait(5)
     boolLoginFlag1 = self.isElementExist(
         ('android uiautomator',
          'new UiSelector().resourceId("gaosi.com.learn:id/edt_phone")'))
     if boolLoginFlag1:
         print(
             '**************************************登录学生端************************************'
         )
         self.sendkeys_text(('id', 'gaosi.com.learn:id/edt_phone'),
                            self.user)
         self.sendkeys_text(('id', 'gaosi.com.learn:id/edt_pass'),
                            self.passwd)
         time.sleep(2)
         self.waitForclick(("id", "gaosi.com.learn:id/btn_login"))  #点击登录
         #登录后存在个人装扮功能弹窗,点击X关闭(只要不选择性别,就一直会弹窗)
         self.is_element_exist_and_click(
             ('id', 'gaosi.com.learn:id/ibBack2'))
         #time.sleep(5)
         print(
             '**************************************登录学生端完成************************************'
         )
Esempio n. 2
0
 def setUp(self):
     # 获取我们设定的capabilities,通知Appium Server创建相应的会话。
     self.desired_caps = desired_capabilities.get_desired_capabilities()
     # 获取server的地址。
     self.uri = desired_capabilities.get_uri()
     self.timeout = 10
      # 获取用户名和密码
     self.user = desired_capabilities.getParam("username")
     self.passwd = desired_capabilities.getParam("password")
     print "登录用户%s" % self.user
     self.driver = webdriver.Remote(self.uri, self.desired_caps)
     self.driver.implicitly_wait(5)
     boolLoginFlag1 = self.isElementExist(('android uiautomator', 'new UiSelector().resourceId("gaosi.com.learn:id/edt_phone")'))
     if boolLoginFlag1:
         print('**************************************登录学生端************************************')
         self.sendkeys_text(('id', 'gaosi.com.learn:id/edt_phone'), self.user)
         self.sendkeys_text(('id', 'gaosi.com.learn:id/edt_pass'), self.passwd)
         time.sleep(2)
         self.waitForclick(("id", "gaosi.com.learn:id/btn_login"))  #点击登录
         time.sleep(2)
         for i in range(0, 3):
             print("第%s次点击引导页"%(i+1))
             time.sleep(2)
             self.tapScreen(540, 1000)
         time.sleep(2)
         # 登录后新账号会提示修改密码,暂不修改
         self.is_element_exist_and_click(('id', 'gaosi.com.learn:id/tv_cancel'))
         print('************************************登录学生端完成**********************************')
Esempio n. 3
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)
Esempio n. 4
0
 def setUp(self):
     # 获取我们设定的capabilities,通知Appium Server创建相应的会话。
     desired_caps = desired_capabilities.get_desired_capabilities()
     # 获取server的地址。
     uri = desired_capabilities.get_uri()
     # 获取使用的测试框架
     self.automationName = desired_caps.get('automationName')
     # 创建会话,得到driver对象,driver对象封装了所有的设备操作。下面会具体讲。
     self.driver = webdriver.Remote(uri, desired_caps)
Esempio n. 5
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)));
Esempio n. 6
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)
Esempio n. 7
0
 def setUp(self):
     desired_caps = desired_capabilities.get_desired_capabilities()
     uri = desired_capabilities.get_uri()
     retry = 0
     while retry < 3:
         try:
             self.driver = webdriver.Remote(uri, desired_caps)
             break
         except Exception, e:
             print "Appium server init failed: %s" % str(e)
             retry += 1
Esempio n. 8
0
    def setUp(self):
        # 获取capabilities, 通知Appium Server创建相应的会话
        desired_caps = desired_capabilities.get_desired_capabilities()

        # 获取server的地址
        uri = desired_capabilities.get_uri()

        # 获取使用的测试框架
        self.automationName = desired_caps.get('automationName')

        # 创建会话,得到driver对象
        self.driver = webdriver.Remote(uri, desired_caps)
Esempio n. 9
0
 def setUp(self):
     # 获取我们设定的capabilities,通知Appium Server创建相应的会话。
     self.desired_caps = desired_capabilities.get_desired_capabilities()
     # 获取server的地址。
     self.uri = desired_capabilities.get_uri()
     self.timeout = 30
Esempio n. 10
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)
Esempio n. 11
0
    def setUp(self):

        desired_caps = desired_capabilities.get_desired_capabilities()
        uri = desired_capabilities.get_uri()
        self.automationName = desired_caps.get('automationName')
        self.driver = webdriver.Remote(uri, desired_caps)
Esempio n. 12
0
    def setUpClass(self):
        desired_cap = desired_capabilities.get_desired_capabilities()

        uri = desired_capabilities.get_uri()

        self.driver = webdriver.Remote(uri, desired_cap)