def InputEnterpriseInfo(self):
        print(
            '—————————————————————————————企业信息页面载入中,请稍后————————————————————————————'
        )
        rsl = excle.excels(self.x, 'Auto_mlrc_EnterpriseInfo_008',
                           "").searche_pth_excel()

        # 截图存档并写入excle
        pic = str(
            snapshots.captrue(self.m, self.z)._capture_creen_ini_(self.driver))

        print("开始输入单位名称。。。。。")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/enterprise_name_text")
        el.click()
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/et_info")
        el.click()
        el.send_keys(self.enterprise_name)
        self.driver.hide_keyboard()
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/title_right_custom")
        el.click()
        print("单位名称输入完成")

        print("开始输入单位地址。。。。。")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/enterprise_address_text")
        el.click()
        #  sleep(1)
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/item_content")
        el.click()
        # sleep(1)
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/textView")
        el.click()
        #sleep(2)
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/textView")
        el.click()
        #sleep(2)
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/textView")
        el.click()
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/et_addr")
        el.click()
        el.send_keys(self.et_addr)
        self.driver.hide_keyboard()
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/title_right_custom")
        el.click()
        print("单位地址输入成功")
        #sleep(3)

        print("开始选择注册日期。。。。。")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/registration_date_text")
        el.click()
        el = self.driver.find_element_by_id("android:id/numberpicker_input")
        el.click()

        # 分别在年月日上进行滑动选择
        self.driver.swipe(150, 980, 150, 1150)
        self.driver.swipe(150, 980, 150, 1150)
        self.driver.swipe(350, 980, 350, 1150)
        self.driver.swipe(350, 980, 350, 1150)
        self.driver.swipe(560, 980, 560, 1150)
        self.driver.swipe(560, 980, 560, 1150)

        el = self.driver.find_element_by_id("com.rjs.ddjr:id/done")
        el.click()
        print("注册日期已选择")
        #sleep(3)

        print("请输入月营业额。。。。。")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/monthly_turnover_edit")
        el.clear()
        el.click()
        el.send_keys(self.monthly_turnover)
        self.driver.hide_keyboard()
        print("月营业额已输入")
        #        sleep(3)

        print("请输入单位电话。。。。。")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/enterprise_phone_edit")
        el.clear()
        el.click()
        el.send_keys(self.enterprise_phone)
        self.driver.hide_keyboard()
        print("单位电话已输入")
        #        sleep(3)

        print("开始选择企业资料类型。。。。。")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/enterprise_information_text")
        el.click()
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/rb_2")
        el.click()
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/tv_confirm")
        el.click()

        # 开始上传企业照片
        self.driver.find_element_by_id("com.rjs.ddjr:id/iv_pic").click()
        self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        #        sleep(6)
        self.driver.find_element_by_id(
            "com.rjs.ddjr:id/title_right_custom").click()
        #       sleep(3)
        print("企业资料已上传")

        # 新增了央行征信报告字段
        print("开始上传央行征信报告。。。。。")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/credit_report_text")
        el.click()

        # 开始上传央行征信报告照片
        self.driver.find_element_by_id("com.rjs.ddjr:id/iv_pic").click()
        self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        #      sleep(6)
        self.driver.find_element_by_id(
            "com.rjs.ddjr:id/title_right_custom").click()
        #     sleep(3)
        print("央行征信报告已上传")

        self.driver.find_element_by_id("com.rjs.ddjr:id/draft_save").click()
        #    sleep(1)
        print("——————————————————————————草稿录单模块,企业信息页面已保存!——————————————————")

        # 评审修改时间2017/5/4
        # 加入检查点,并最终判断case执行的结果是通过还是不通过
        self.driver.start_activity(
            'com.rjs.ddjr', 'com.rjs.ddjr.publicmodel.view.HomeActivity')
        #   sleep(6)

        try:
            el = self.driver.find_element_by_id(
                "com.rjs.ddjr:id/main_btn_message")
            el.click()
            el = self.driver.find_element_by_id("com.rjs.ddjr:id/draft")
            el.click()
            #      sleep(1)
            el = self.driver.find_element_by_id("com.rjs.ddjr:id/cheyidai_tab")
            el.click()
            el = self.driver.find_element_by_id(
                'com.rjs.ddjr:id/draft_item_name')
            print(el.text)
            if el.text == "suzhoutest":
                flag = 'P'
            if el.text != "suzhoutest":
                flag = 'F'
            print(flag)

            el = self.driver.find_element_by_id("com.rjs.ddjr:id/draft_layout")
            el.click()
            self.driver.find_element_by_id("com.rjs.ddjr:id/draft_enterprise")
            el = self.driver.find_element_by_id(
                "com.rjs.ddjr:id/draft_enterprise_progress")
            print(el.text)
            if el.text == "完成:100%":
                flag = "P"
            if el.text != "完成:100%":
                flag = "F"
            print(flag)

            # 将结果写入到case和log日志中
            logstr = str(self.driver.get_log("logcat"))
            excle.excels(self.x, self.z, flag).write_excel(rsl, 10)
            Logs.logs(self.y, self.z, flag)._writ_file()
            Logs.logs(self.y, 'logcat', logstr)._writ_file()

            excle.excels(self.x, self.z, pic).write_excel(2, 11)

    #     sleep(10)

        except:
            info = str(sys.exc_info())
            Logs.logs(self.y, self.z, info)._writ_file()
    def InputIncomeInfo(self):
        print(
            '—————————————————————————————收入信息页面载入中,请稍后————————————————————————————'
        )
        rsl = excle.excels(self.x, 'Auto_mlrc_IncomeInfo_005',
                           "").searche_pth_excel()
        # 截图存档并写入excle
        pic = str(
            snapshots.captrue(self.m, self.z)._capture_creen_ini_(self.driver))

        print("开始输入收入来源")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/income_source_text")
        el.click()
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/et_info")
        el.clear()
        el.click()
        el.send_keys(self.income_source)
        self.driver.hide_keyboard()
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/title_right_custom")
        el.click()
        print("收入来源已输入")

        print("开始输入每月收入")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/monthly_income_edit")
        el.clear()
        el.click()
        el.send_keys(self.monthly_income)
        self.driver.hide_keyboard()
        print("每月收入已输入")

        print("开始选择收入类型")
        self.driver.find_element_by_id(
            "com.rjs.ddjr:id/income_certificate_text").click()
        # self.driver.implicitly_wait(1)
        self.driver.find_element_by_id("com.rjs.ddjr:id/rb_1").click()
        self.driver.find_element_by_id("com.rjs.ddjr:id/tv_confirm").click()
        print("开始上传收入证明")
        self.driver.find_element_by_id("com.rjs.ddjr:id/iv_pic").click()
        self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        self.driver.implicitly_wait(6)
        self.driver.find_element_by_id(
            'com.rjs.ddjr:id/title_right_custom').click()
        print('收入证明上传成功!')

        print("开始上传央行征信报告")
        self.driver.find_element_by_id(
            "com.rjs.ddjr:id/credit_report_text").click()
        # self.driver.implicitly_wait(1)
        self.driver.find_element_by_id("com.rjs.ddjr:id/iv_pic").click()
        self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        self.driver.implicitly_wait(6)
        self.driver.find_element_by_id(
            'com.rjs.ddjr:id/title_right_custom').click()
        print('央行征信报告上传成功!')

        self.driver.find_element_by_id("com.rjs.ddjr:id/draft_save").click()
        # self.driver.implicitly_wait(2)
        print("——————————————————————————草稿录单模块,收入信息页面已保存!——————————————————")

        # 评审修改时间2017/5/4
        # 加入检查点,并最终判断case执行的结果是通过还是不通过
        self.driver.start_activity(
            'com.rjs.ddjr', 'com.rjs.ddjr.publicmodel.view.HomeActivity')
        #  sleep(6)

        try:
            el = self.driver.find_element_by_id(
                "com.rjs.ddjr:id/main_btn_message")
            el.click()
            el = self.driver.find_element_by_id("com.rjs.ddjr:id/draft")
            el.click()
            self.driver.implicitly_wait(1)
            el = self.driver.find_element_by_id("com.rjs.ddjr:id/cheyidai_tab")
            el.click()
            el = self.driver.find_element_by_id(
                'com.rjs.ddjr:id/draft_item_name')
            print(el.text)
            if el.text == "suzhoutest":
                flag = 'P'
            if el.text != "suzhoutest":
                flag = 'F'
            print(flag)

            el = self.driver.find_element_by_id("com.rjs.ddjr:id/draft_layout")
            el.click()
            self.driver.find_element_by_id("com.rjs.ddjr:id/draft_income")
            el = self.driver.find_element_by_id(
                "com.rjs.ddjr:id/draft_income_progress")
            print(el.text)
            if el.text == "完成:100%":
                flag = "P"
            if el.text != "完成:100%":
                flag = "F"
            print(flag)

            # 将结果写入到case和log日志中
            logstr = str(self.driver.get_log("logcat"))
            excle.excels(self.x, self.z, flag).write_excel(rsl, 10)
            Logs.logs(self.y, self.z, flag)._writ_file()
            Logs.logs(self.y, 'logcat', logstr)._writ_file()

            excle.excels(self.x, self.z, pic).write_excel(2, 11)
            #sleep(10)

        except:
            info = str(sys.exc_info())
            Logs.logs(self.y, self.z, info)._writ_file()
    def login(self):
        rsl = excle.excels(self.x, 'Auto_mlrc_login_001',
                           "").searche_pth_excel()
        try:
            # 评审修改时间2017/5/4
            # 截图存档并写入excle
            pic = str(
                snapshots.captrue(self.m,
                                  self.z)._capture_creen_ini_(self.driver))

            el_account = self.driver.find_element_by_id(
                'com.rjs.ddjr:id/login_phone')
            el_account.click()
            el_account.send_keys('13063835945')
            print('手机号输入成功')
            el_password = self.driver.find_element_by_id(
                'com.rjs.ddjr:id/login_password')
            el_password.click()
            el_password.send_keys('123456')
            print('密码输入成功')
            self.driver.hide_keyboard()
            el_login = self.driver.find_element_by_id(
                'com.rjs.ddjr:id/login_commit')
            el_login.click()
            sleep(5)

            # 登录成功后
            print(
                '——————————————————————————————登录成功————————————————————————————————'
            )

            # 评审修改时间2017/5/4
            # 加入检查点,并最终判断case执行的结果是通过还是不通过
            self.driver.start_activity(
                'com.rjs.ddjr', 'com.rjs.ddjr.publicmodel.view.HomeActivity')
            # self.driver.start_activity('com.rjs.ddjr', 'com.rjs.ddjr.publicmodel.view.mine.PersonSettingActivity')

            # # 去掉升级,点击【我的】按钮,进入我的页面
            # el = self.driver.find_element_by_id("android:id/button2")
            # el.click()
            # sleep(1)
            el = self.driver.find_element_by_id(
                "com.rjs.ddjr:id/main_btn_myset")
            el.click()
            sleep(1)

            # 查找手机号,判断是否为登录账户
            el = self.driver.find_element_by_id('com.rjs.ddjr:id/head_phone')
            el = self.driver.find_element_by_id("com.rjs.ddjr:id/head_layout")
            el.click()
            el = self.driver.find_element_by_id("com.rjs.ddjr:id/person_phone")
            print(el.text)
            if el.text == "13063835945":
                flag = 'P'
            if el.text != "13063835945":
                flag = 'F'
            # 评审修改时间2017/5/4
            print(flag)

            # 将结果写入到case和log日志中
            logstr = str(self.driver.get_log("logcat"))
            excle.excels(self.x, self.z, flag).write_excel(rsl, 10)
            Logs.logs(self.y, self.z, flag)._writ_file()
            Logs.logs(self.y, 'logcat', logstr)._writ_file()

            excle.excels(self.x, self.z, pic).write_excel(2, 11)
            sleep(10)

        except:
            info = str(sys.exc_info())
            Logs.logs(self.y, self.z, info)._writ_file()
    def InputCarPhotoInfo(self):
        print('—————————————————————————————车辆照片页面载入中,请稍后————————————————————————————')
        rsl = excle.excels(self.x, 'Auto_mlrc_CarPhoto_007', "").searche_pth_excel()
        # 截图存档并写入excle
        pic = str(snapshots.captrue(self.m, self.z)._capture_creen_ini_(self.driver))

        # # 车主与车辆照片
        # print("开始上传车主与车辆照片。。。。。")
        # self.driver.find_element_by_xpath("//android.widget.ScrollView[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[1]/android.widget.ImageView[1]").click()
        # sleep(2)
        # self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        # sleep(2)
        # self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        # sleep(6)
        # print("车主与车辆照片上传成功")
        #
        # # 车前45度照
        # print("开始上传车前45度照。。。。。")
        # self.driver.find_element_by_xpath("//android.widget.ScrollView[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[2]/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[1]/android.widget.ImageView[1]").click()
        # sleep(3)
        # self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        # sleep(2)
        # self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        # sleep(6)
        # print("车前45度照上传成功")
        #
        # # 正后照
        # print("开始上传正后照。。。。。")
        # self.driver.find_element_by_xpath("//android.widget.ScrollView[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[3]/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[1]/android.widget.ImageView[1]").click()
        # sleep(3)
        # self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        # sleep(2)
        # self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        # sleep(6)
        # print("正后照上传成功")
        #
        #
        # ########################################### 往上滑动一次,每次只划过三个###################################
        # self.driver.swipe(400, 1088, 400, 260)
        #
        #
        #
        # # 后尾厢照
        # print("开始上传后尾厢照。。。。。")
        # self.driver.find_element_by_xpath("//android.widget.ScrollView[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[2]/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[1]/android.widget.ImageView[1]").click()
        # sleep(3)
        # self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        # sleep(2)
        # self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        # sleep(6)
        # print("后尾厢照上传成功")
        #
        # # 主驾门叶照
        # print("开始上传主驾门叶照。。。。。")
        # self.driver.find_element_by_xpath("//android.widget.ScrollView[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[3]/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[1]/android.widget.ImageView[1]").click()
        # sleep(3)
        # self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        # sleep(2)
        # self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        # sleep(6)
        # print("主驾门叶照上传成功")
        #
        # # 主驾驶侧照
        # print("开始上传主驾驶侧照。。。。。")
        # self.driver.find_element_by_xpath("//android.widget.ScrollView[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[4]/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[1]/android.widget.ImageView[1]").click()
        # sleep(3)
        # self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        # sleep(2)
        # self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        # sleep(6)
        # print("主驾驶侧照上传成功")
        #
        #
        # ########################################### 往上滑动一次,每次只划过三个###################################
        # self.driver.swipe(400, 1022, 400, 143)
        #
        #
        # # 主驾驶正照
        # print("开始上传主驾驶正照。。。。。")
        # self.driver.find_element_by_xpath("//android.widget.ScrollView[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[2]/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[1]/android.widget.ImageView[1]").click()
        # sleep(3)
        # self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        # sleep(2)
        # self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        # sleep(6)
        # print("主驾驶正照上传成功")
        #
        # # 左方向盘照
        # print("开始上传左方向盘照。。。。。")
        # self.driver.find_element_by_xpath("//android.widget.ScrollView[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[3]/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[1]/android.widget.ImageView[1]").click()
        # sleep(3)
        # self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        # sleep(2)
        # self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        # sleep(6)
        # print("左方向盘照上传成功")
        #
        # # 右方向盘照
        # print("开始上传右方向盘照。。。。。")
        # self.driver.find_element_by_xpath("//android.widget.ScrollView[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[4]/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[1]/android.widget.ImageView[1]").click()
        # sleep(3)
        # self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        # sleep(2)
        # self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        # sleep(6)
        # print("右方向盘照上传成功")
        #
        #
        #
        # ########################################### 往上滑动一次,每次只划过三个###################################
        # self.driver.swipe(400, 1022, 400, 143)
        #
        #
        # # 后内饰照
        # print("开始上传后内饰照。。。。。")
        # self.driver.find_element_by_xpath("//android.widget.ScrollView[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[2]/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[1]/android.widget.ImageView[1]").click()
        # sleep(3)
        # self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        # sleep(2)
        # self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        # sleep(6)
        # print("后内饰照上传成功")
        #
        # # 仪表盘照
        # print("开始上传仪表盘照。。。。。")
        # self.driver.find_element_by_xpath("//android.widget.ScrollView[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[3]/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[1]/android.widget.ImageView[1]").click()
        # sleep(3)
        # self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        # sleep(2)
        # self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        # sleep(6)
        # print("仪表盘照上传成功")
        #
        # # 铭牌照
        # print("开始上传铭牌照。。。。。")
        # self.driver.find_element_by_xpath("//android.widget.ScrollView[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[4]/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[1]/android.widget.ImageView[1]").click()
        # sleep(3)
        # self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        # sleep(2)
        # self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        # sleep(6)
        # print("铭牌照上传成功")
        #
        # self.driver.find_element_by_id("com.rjs.ddjr:id/tv_next").click()
        # sleep(3)
        # print("——————————————————————————草稿录单模块,车辆照片信息页面已保存!——————————————————")



        #################################################################################     使用以下新的代码   ################################################################################


        # 车主与车辆照片
        print("开始上传车主与车辆照片")
        self.driver.find_element_by_id("com.rjs.ddjr:id/car0").click()
        sleep(2)
        self.driver.find_element_by_id("com.rjs.ddjr:id/iv_car").click()
        sleep(6)
        self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        sleep(2)
        self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        sleep(6)
        print("车主与车辆照片上传成功")


        ########### 往上滑动一次##########
        self.driver.swipe(400, 502, 400, 142)


        # 车前45度照
        print("开始上传车前45度照")
        self.driver.find_element_by_id("com.rjs.ddjr:id/car1").click()
        sleep(2)
        self.driver.find_element_by_id("com.rjs.ddjr:id/iv_car").click()
        sleep(3)
        self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        sleep(2)
        self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        sleep(6)
        print("车前45度照上传成功")



        ########### 往上滑动一次##########
        self.driver.swipe(400, 434, 400, 141)

        # 正后照
        print("开始上传正后照")
        self.driver.find_element_by_id("com.rjs.ddjr:id/car2").click()
        sleep(2)
        self.driver.find_element_by_id("com.rjs.ddjr:id/iv_car").click()
        sleep(3)
        self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        sleep(2)
        self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        sleep(6)
        print("正后照上传成功")


        ########### 往上滑动一次##########
        self.driver.swipe(400, 434, 400, 143)


        # 后尾厢照
        print("开始上传后尾厢照")
        self.driver.find_element_by_id("com.rjs.ddjr:id/car3").click()
        sleep(2)
        self.driver.find_element_by_id("com.rjs.ddjr:id/iv_car").click()
        sleep(3)
        self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        sleep(2)
        self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        sleep(6)
        print("后尾厢照上传成功")


        ########### 往上滑动一次##########
        self.driver.swipe(400, 434, 400, 143)




        # 主驾门叶照
        print("开始上传主驾门叶照")
        self.driver.find_element_by_id("com.rjs.ddjr:id/car4").click()
        sleep(2)
        self.driver.find_element_by_id("com.rjs.ddjr:id/iv_car").click()
        sleep(3)
        self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        sleep(2)
        self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        sleep(6)
        print("主驾门叶照上传成功")


        ########### 往上滑动一次##########
        self.driver.swipe(400, 434, 400, 141)


        # 主驾驶侧照
        print("开始上传主驾驶侧照")
        self.driver.find_element_by_id("com.rjs.ddjr:id/car5").click()
        sleep(2)
        self.driver.find_element_by_id("com.rjs.ddjr:id/iv_car").click()
        sleep(3)
        self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        sleep(2)
        self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        sleep(6)
        print("主驾驶侧照上传成功")


        ########### 往上滑动一次##########
        self.driver.swipe(400, 434, 400, 148)



        # 主驾驶正照
        print("开始上传主驾驶正照")
        self.driver.find_element_by_id("com.rjs.ddjr:id/car6").click()
        sleep(2)
        self.driver.find_element_by_id("com.rjs.ddjr:id/iv_car").click()
        sleep(3)
        self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        sleep(2)
        self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        sleep(6)
        print("主驾驶正照上传成功")



        ########### 往上滑动一次##########
        self.driver.swipe(400, 434, 400, 138)



        # 左方向盘照
        print("开始上传左方向盘照")
        self.driver.find_element_by_id("com.rjs.ddjr:id/car7").click()
        sleep(2)
        self.driver.find_element_by_id("com.rjs.ddjr:id/iv_car").click()
        sleep(3)
        self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        sleep(2)
        self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        sleep(6)
        print("左方向盘照上传成功")


        ########### 往上滑动一次##########
        self.driver.swipe(400, 434, 400, 141)


        # 右方向盘照
        print("开始上传右方向盘照")
        self.driver.find_element_by_id("com.rjs.ddjr:id/car8").click()
        sleep(2)
        self.driver.find_element_by_id("com.rjs.ddjr:id/iv_car").click()
        sleep(3)
        self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        sleep(2)
        self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        sleep(6)
        print("右方向盘照上传成功")



        ########### 往上滑动一次##########
        self.driver.swipe(400, 434, 400, 141)


        # 后内饰照
        print("开始上传后内饰照。。。。。")
        self.driver.find_element_by_xpath("//android.widget.ScrollView[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[2]/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[1]/android.widget.ImageView[1]").click()
        sleep(3)
        self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        sleep(2)
        self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        sleep(6)
        print("后内饰照上传成功")


        # 仪表盘照
        print("开始上传仪表盘照。。。。。")
        self.driver.find_element_by_xpath("//android.widget.ScrollView[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[3]/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[1]/android.widget.ImageView[1]").click()
        sleep(3)
        self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        sleep(2)
        self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        sleep(6)
        print("仪表盘照上传成功")


        # 铭牌照
        print("开始上传铭牌照。。。。。")
        self.driver.find_element_by_xpath("//android.widget.ScrollView[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[4]/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[1]/android.widget.ImageView[1]").click()
        sleep(3)
        self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        sleep(2)
        self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        sleep(6)
        print("铭牌照上传成功")

        self.driver.find_element_by_id("com.rjs.ddjr:id/tv_next").click()
        sleep(3)
        print("——————————————————————————草稿录单模块,车辆照片信息页面已保存!——————————————————")


        try:

           # 评审修改时间2017/5/4
            # 加入检查点,并最终判断case执行的结果是通过还是不通过
            self.driver.start_activity('com.rjs.ddjr', 'com.rjs.ddjr.publicmodel.view.HomeActivity')

            # 去掉升级,点击【工作台】按钮,进入草稿录单页面
            # el = self.driver.find_element_by_id("android:id/button2")
            # el.click()
            sleep(1)
            el = self.driver.find_element_by_id("com.rjs.ddjr:id/main_btn_message")
            el.click()
            el = self.driver.find_element_by_id("com.rjs.ddjr:id/draft")
            el.click()
            sleep(1)
            el = self.driver.find_element_by_id("com.rjs.ddjr:id/cheyidai_tab")
            el.click()
            el = self.driver.find_element_by_id('com.rjs.ddjr:id/draft_item_name')
            print(el.text)
            if el.text == "suzhoutest":
                flag = 'P'
            if el.text != "suzhoutest":
                flag = 'F'
            print(flag)



            el = self.driver.find_element_by_id("com.rjs.ddjr:id/draft_layout")
            el.click()
            self.driver.find_element_by_id("com.rjs.ddjr:id/draft_car_photo")
            el = self.driver.find_element_by_id("com.rjs.ddjr:id/draft_car_photo_progress")
            print(el.text)
            if el.text == "完成:100%":
                flag = "P"
            if el.text != "完成:100%":
                flag = "F"
            print(flag)


            # 将结果写入到case和log日志中
            logstr = str(self.driver.get_log("logcat"))
            excle.excels(self.x, self.z, flag).write_excel(rsl, 10)
            Logs.logs(self.y, self.z, flag)._writ_file()
            Logs.logs(self.y, 'logcat', logstr)._writ_file()

            excle.excels(self.x, self.z, pic).write_excel(2, 11)
            sleep(10)


        except:
            info = str(sys.exc_info())
            Logs.logs(self.y, self.z, info)._writ_file()
    def InputRelativiesInfo(self):
        print(
            '—————————————————————————————联系人信息页面载入中,请稍后————————————————————————————'
        )
        rsl = excle.excels(self.x, 'Auto_mlrc_RelativiesInfo_006',
                           "").searche_pth_excel()
        # 截图存档并写入excle
        pic = str(
            snapshots.captrue(self.m, self.z)._capture_creen_ini_(self.driver))
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/relatives_name_edit")
        print("开始输入姓名")
        el.clear()
        el.click()
        el.send_keys(self.relatives_name)
        self.driver.hide_keyboard()
        print("姓名输入完成")

        print("开始输入联系电话")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/relatives_phone_edit")
        el.clear()
        el.click()
        el.send_keys(self.relatives_phone)
        print("联系电话输入完成")

        print("开始输入工作单位")
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/work_unit_text")
        el.click()
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/et_info")
        el.clear()
        el.click()
        el.send_keys(self.work_unit)
        self.driver.hide_keyboard()
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/title_right_custom")
        el.click()
        print("工作单位输入完成")

        print("开始选择是否知晓贷款")
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/known_loan_text")
        el.click()
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/wheel")
        el.click()

        # # 往上翻动
        # self.driver.swipe(380, 1000, 380, 800)
        # self.driver.implicitly_wait(1000)

        el = self.driver.find_element_by_id("com.rjs.ddjr:id/done")
        el.click()
        print("是否知晓贷款已选择")
        # self.driver.implicitly_wait(1)

        # print("开始填写备注。。。。。")
        # el = self.driver.find_element_by_id("com.rjs.ddjr:id/relative_remark_text")
        # el.click()
        # el = self.driver.find_element_by_id("com.rjs.ddjr:id/et_info")
        # el.clear()
        # el.click()
        # el.send_keys(self.et_info)
        # self.driver.hide_keyboard()
        # el = self.driver.find_element_by_id("com.rjs.ddjr:id/title_right_custom")
        # el.click()
        # print("备注填写完成")
        # self.driver.implicitly_wait(1)

        self.driver.find_element_by_id("com.rjs.ddjr:id/draft_save").click()
        # self.driver.implicitly_wait(1)
        print("——————————————————————————草稿录单模块,联系人信息页面已保存!——————————————————")

        # 评审修改时间2017/5/4
        # 加入检查点,并最终判断case执行的结果是通过还是不通过
        self.driver.start_activity(
            'com.rjs.ddjr', 'com.rjs.ddjr.publicmodel.view.HomeActivity')
        # sleep(6)

        try:
            el = self.driver.find_element_by_id(
                "com.rjs.ddjr:id/main_btn_message")
            el.click()
            el = self.driver.find_element_by_id("com.rjs.ddjr:id/draft")
            el.click()
            #  sleep(1)
            el = self.driver.find_element_by_id("com.rjs.ddjr:id/cheyidai_tab")
            el.click()
            el = self.driver.find_element_by_id(
                'com.rjs.ddjr:id/draft_item_name')
            print(el.text)
            if el.text == "suzhoutest":
                flag = 'P'
            if el.text != "suzhoutest":
                flag = 'F'
            print(flag)

            el = self.driver.find_element_by_id("com.rjs.ddjr:id/draft_layout")
            el.click()
            self.driver.find_element_by_id("com.rjs.ddjr:id/draft_relatives")
            el = self.driver.find_element_by_id(
                "com.rjs.ddjr:id/draft_relatives_progress")
            print(el.text)
            if el.text == "完成:100%":
                flag = "P"
            if el.text != "完成:100%":
                flag = "F"
            print(flag)

            # 将结果写入到case和log日志中
            logstr = str(self.driver.get_log("logcat"))
            excle.excels(self.x, self.z, flag).write_excel(rsl, 10)
            Logs.logs(self.y, self.z, flag)._writ_file()
            Logs.logs(self.y, 'logcat', logstr)._writ_file()

            excle.excels(self.x, self.z, pic).write_excel(2, 11)
        #    sleep(10)

        except:
            info = str(sys.exc_info())
            Logs.logs(self.y, self.z, info)._writ_file()
Exemplo n.º 6
0
    def InputVehicleInfo(self):
        print(
            '—————————————————————————————房产车辆信息页面载入中,请稍后————————————————————————————'
        )
        rsl = excle.excels(self.x, 'Auto_mlrc_VehicleInfo_004',
                           "").searche_pth_excel()

        # 截图存档并写入excle
        pic = str(
            snapshots.captrue(self.m, self.z)._capture_creen_ini_(self.driver))

        print('开始上传行驶证主页')
        self.driver.find_element_by_id(
            "com.rjs.ddjr:id/driving_license_page").click()
        print("开始勾选图片,进行上传。。。。。")
        self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        sleep(3)
        self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        print('行驶证主页上传成功!')
        sleep(6)

        print("开始输入车牌")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/license_plate_text")
        el.click()
        # 选择代号
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/tv_1")
        el.click()
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/tv_item_filter")
        el.click()
        # 选择字母
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/tv_2")
        el.click()
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/tv_item_filter")
        el.click()
        # 选择号码
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/et_num")
        el.clear()
        el.click()
        el.send_keys(self.license_plate)
        self.driver.hide_keyboard()
        # 保存车牌
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/title_right_custom")
        el.click()
        print("车牌号码已输入")
        sleep(3)

        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/registration_date_text")
        el.click()
        print("开始选择注册日期。。。。。")
        self.driver.implicitly_wait(100)
        el = self.driver.find_element_by_id("android:id/numberpicker_input")
        el.click()

        # 往下翻动,选择年份(年份越来越小)
        self.driver.swipe(140, 1000, 140, 1160)
        self.driver.swipe(360, 1000, 360, 1160)
        self.driver.swipe(560, 1000, 560, 1160)
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/done")
        el.click()
        print("注册日期已选择")
        sleep(3)

        print("开始选择发证日期。。。。。")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/date_of_issue_text")
        el.click()
        print("")
        self.driver.implicitly_wait(100)
        el = self.driver.find_element_by_id("android:id/numberpicker_input")
        el.click()
        # 往下翻动,选择年份(年份越来越小)
        self.driver.swipe(140, 1000, 140, 1160)
        self.driver.swipe(360, 1000, 360, 1160)
        self.driver.swipe(560, 1000, 560, 1160)
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/done")
        el.click()
        print("发证日期已选择")
        sleep(3)

        print('开始输入车辆识别码')
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/vehicle_identification_code_edit")
        el.clear()
        el.click()
        el.send_keys(self.vehicle_identification_code)
        self.driver.hide_keyboard()
        print('车辆识别码已输入')
        sleep(3)

        print('开始输入发送机号码')
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/engine_number_edit")
        el.clear()
        el.click()
        el.send_keys(self.engine_number)
        self.driver.hide_keyboard()
        print('发动机号码已选择')
        sleep(3)

        print('开始输入车辆类型')
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/vehicle_type_edit")
        el.clear()
        el.click()
        el.send_keys(self.vehicle_type)
        self.driver.hide_keyboard()
        print('车辆类型已输入')
        sleep(3)

        # 往下滑动一次
        self.driver.swipe(300, 1000, 300, 500)
        self.driver.swipe(300, 1000, 300, 500)

        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/driving_vice_text")
        el.click()
        print("开始点击行驶证副页,进行上传。。。。。")
        self.driver.find_element_by_id("com.rjs.ddjr:id/iv_pic").click()
        self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        sleep(6)
        self.driver.find_element_by_id(
            'com.rjs.ddjr:id/title_right_custom').click()
        print('行驶证副页上传成功!')
        sleep(6)

        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/vehicle_registration_certificate_text")
        el.click()
        print("开始点击车辆登记证,进行上传。。。。。")
        self.driver.find_element_by_id("com.rjs.ddjr:id/iv_pic").click()
        sleep(2)
        self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        sleep(6)
        self.driver.find_element_by_id(
            'com.rjs.ddjr:id/title_right_custom').click()
        print('车辆登记证上传成功!')
        sleep(6)

        print("开始选择车系品牌")
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/car_text")
        el.click()
        el = self.driver.find_element_by_name("AC Schnitzer")
        el.click()
        sleep(3)
        el = self.driver.find_element_by_name("AC Schnitzer Eagle")
        el.click()
        print('车系品牌已选择')
        sleep(3)

        print("开始选择车辆归属")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/vehicle_ownership_text")
        el.click()
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/wheel")
        el.click()

        # 往上滑动
        self.driver.swipe(400, 1000, 400, 800)
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/done")
        el.click()
        print('车辆归属已选择')
        sleep(3)

        print("开始选择购车时间")
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/buying_time_text")
        el.click()
        el = self.driver.find_element_by_id("android:id/numberpicker_input")
        el.click()

        # 往下翻动,选择年份(年份越来越小)
        self.driver.swipe(140, 1000, 140, 1160)
        self.driver.swipe(360, 1000, 360, 1160)
        self.driver.swipe(560, 1000, 560, 1160)
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/done")
        el.click()
        print('购车时间已选择')
        sleep(3)

        print("开始选择初次登记时间")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/initial_registration_time_text")
        el.click()
        el = self.driver.find_element_by_id("android:id/numberpicker_input")
        el.click()

        # 往下翻动,选择年份(年份越来越小)
        self.driver.swipe(140, 1000, 140, 1160)
        self.driver.swipe(360, 1000, 360, 1160)
        self.driver.swipe(560, 1000, 560, 1160)
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/done")
        el.click()
        print('初次登记时间已选择')
        sleep(3)

        print("输入购买价格")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/purchase_price_edit")
        el.clear()
        el.click()
        el.send_keys(self.purchase_price)
        self.driver.hide_keyboard()
        print("购买价格输入完成")
        sleep(3)

        print("输入一年内抵押次数")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/mortgage_number_edit")
        el.clear()
        el.click()
        el.send_keys(self.mortgage_number)
        self.driver.hide_keyboard()
        print("一年内抵押次数输入完成")
        sleep(3)

        print("开始选择交强险保单合同")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/contract_of_insurance_text")
        el.click()
        print("开始点击交强险保单合同,进行上传。。。。。")
        self.driver.find_element_by_id("com.rjs.ddjr:id/iv_pic").click()
        self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        sleep(6)
        self.driver.find_element_by_id(
            'com.rjs.ddjr:id/title_right_custom').click()
        print('交强险保单合同上传成功!')
        sleep(6)

        print("开始选择商业险保单合同")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/commercial_insurance_contract_text")
        el.click()
        print("开始点击商业险保单合同,进行上传。。。。。")
        self.driver.find_element_by_id("com.rjs.ddjr:id/iv_pic").click()
        self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        sleep(6)
        self.driver.find_element_by_id(
            'com.rjs.ddjr:id/title_right_custom').click()
        print('商业险保单合同上传成功!')
        sleep(6)
        self.driver.find_element_by_id("com.rjs.ddjr:id/next_step").click()
        sleep(3)
        print("——————————————————————————草稿录单模块,车辆信息页面已保存!——————————————————")

        try:

            # 评审修改时间2017/5/4
            # 加入检查点,并最终判断case执行的结果是通过还是不通过
            self.driver.start_activity(
                'com.rjs.ddjr', 'com.rjs.ddjr.publicmodel.view.HomeActivity')

            # 去掉升级,点击【工作台】按钮,进入草稿录单页面
            # el = self.driver.find_element_by_id("android:id/button2")
            # el.click()
            sleep(1)
            el = self.driver.find_element_by_id(
                "com.rjs.ddjr:id/main_btn_message")
            el.click()
            el = self.driver.find_element_by_id("com.rjs.ddjr:id/draft")
            el.click()
            sleep(1)
            el = self.driver.find_element_by_id("com.rjs.ddjr:id/cheyidai_tab")
            el.click()
            el = self.driver.find_element_by_id(
                'com.rjs.ddjr:id/draft_item_name')
            print(el.text)
            if el.text == "suzhoutest":
                flag = 'P'
            if el.text != "suzhoutest":
                flag = 'F'
            print(flag)

            el = self.driver.find_element_by_id("com.rjs.ddjr:id/draft_layout")
            el.click()
            self.driver.find_element_by_id("com.rjs.ddjr:id/draft_vehicle")
            el = self.driver.find_element_by_id(
                "com.rjs.ddjr:id/draft_vehicle_progress")
            print(el.text)
            if el.text == "完成:100%":
                flag = "P"
            if el.text != "完成:100%":
                flag = "F"
            print(flag)

            # 将结果写入到case和log日志中
            logstr = str(self.driver.get_log("logcat"))
            excle.excels(self.x, self.z, flag).write_excel(rsl, 10)
            Logs.logs(self.y, self.z, flag)._writ_file()
            Logs.logs(self.y, 'logcat', logstr)._writ_file()

            excle.excels(self.x, self.z, pic).write_excel(2, 11)
            sleep(10)

        except:
            info = str(sys.exc_info())
            Logs.logs(self.y, self.z, info)._writ_file()
    def InputHouseInfo(self):
        print(
            '—————————————————————————————房产信息页面载入中,请稍后————————————————————————————'
        )
        rsl = excle.excels(self.x, 'Auto_mlrc_HouseInfo_003',
                           "").searche_pth_excel()
        try:
            # 截图存档并写入excle
            pic = str(
                snapshots.captrue(self.m,
                                  self.z)._capture_creen_ini_(self.driver))

            # 选择是,显示其他字段并进行输入
            print('开始选择本人名下是否有本地商品房')
            el = self.driver.find_element_by_id(
                "com.rjs.ddjr:id/has_house_text")
            el.click()
            sleep(3)
            el = self.driver.find_element_by_id("com.rjs.ddjr:id/wheel")
            el.click()
            sleep(3)

            # print("本人名下是否有房:是")
            # el = self.driver.find_element_by_id("com.rjs.ddjr:id/done")
            # el.click()
            # print("本人名下有住房")
            # sleep(3)
            #
            # print("开始输入房产地址。。。。。")
            # el = self.driver.find_element_by_id("com.rjs.ddjr:id/house_address_text")
            # el.click()
            # el = self.driver.find_element_by_id("com.rjs.ddjr:id/cb_asCardAddr")
            # el.click()
            # print("房产地址输入成功")
            # sleep(3)
            #
            # print("开始选择房产状态。。。。。")
            # el = self.driver.find_element_by_id("com.rjs.ddjr:id/house_status_text")
            # el.click()
            # el = self.driver.find_element_by_id("com.rjs.ddjr:id/cb_asCardAddr")
            # el.click()
            #
            # # 往上滑动
            # self.driver.swipe(400, 1000, 400, 900)
            # sleep(3)
            #
            # el = self.driver.find_element_by_id("com.rjs.ddjr:id/done")
            # el.click()
            # print("房产状态已选择")
            # sleep(3)
            #
            # print("开始勾选房产资料类型。。。。。")
            # el = self.driver.find_element_by_id("com.rjs.ddjr:id/house_images_text")
            # el.click()
            # sleep(3)
            # self.driver.find_element_by_id("com.rjs.ddjr:id/rb_2").click()
            # self.driver.find_element_by_id("com.rjs.ddjr:id/tv_confirm").click()
            # sleep(3)
            # print("开始点击房产图片,进行上传。。。。。")
            # self.driver.find_element_by_id("com.rjs.ddjr:id/iv_pic").click()
            # self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
            # self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
            # sleep(6)
            # print('房产照片上传成功!')
            #
            # self.driver.find_element_by_id("com.rjs.ddjr:id/info_auth_layout").click()
            # self.driver.swipe(400,100,400,800)
            # self.driver.find_element_by_id("com.rjs.ddjr:id/title_right_custom").click()
            # self.driver.implicitly_wait(1000)
            # self.driver.find_element_by_id("com.rjs.ddjr:id/next_step").click()
            # sleep(1)
            # print("——————————————————————————草稿录单模块,房产信息页面已保存!——————————————————")

            # 选择否,直接保存该页面
            self.driver.swipe(400, 1000, 400, 800)
            print("本人名下是否有房:否")
            el = self.driver.find_element_by_id("com.rjs.ddjr:id/done")
            el.click()
            print("本人名下没有住房")
            self.driver.find_element_by_id("com.rjs.ddjr:id/next_step").click()
            sleep(3)
            print(
                "——————————————————————————草稿录单模块,房产信息页面已保存!——————————————————"
            )

            # 评审修改时间2017/5/4
            # 加入检查点,并最终判断case执行的结果是通过还是不通过
            self.driver.start_activity(
                'com.rjs.ddjr', 'com.rjs.ddjr.publicmodel.view.HomeActivity')

            # 去掉升级,点击【工作台】按钮,进入草稿录单页面
            # el = self.driver.find_element_by_id("android:id/button2")
            # el.click()
            sleep(1)
            el = self.driver.find_element_by_id(
                "com.rjs.ddjr:id/main_btn_message")
            el.click()
            el = self.driver.find_element_by_id("com.rjs.ddjr:id/draft")
            el.click()
            sleep(1)
            el = self.driver.find_element_by_id("com.rjs.ddjr:id/cheyidai_tab")
            el.click()
            el = self.driver.find_element_by_id(
                'com.rjs.ddjr:id/draft_item_name')
            print(el.text)
            if el.text == "suzhoutest":
                flag = 'P'
            if el.text != "suzhoutest":
                flag = 'F'
            print(flag)

            el = self.driver.find_element_by_id("com.rjs.ddjr:id/draft_layout")
            el.click()
            self.driver.find_element_by_id("com.rjs.ddjr:id/draft_house")
            el = self.driver.find_element_by_id(
                "com.rjs.ddjr:id/draft_house_progress")
            print(el.text)
            if el.text == "完成:100%":
                flag = "P"
            if el.text != "完成:100%":
                flag = "F"
            print(flag)

            # 将结果写入到case和log日志中
            logstr = str(self.driver.get_log("logcat"))
            excle.excels(self.x, self.z, flag).write_excel(rsl, 10)
            Logs.logs(self.y, self.z, flag)._writ_file()
            Logs.logs(self.y, 'logcat', logstr)._writ_file()

            excle.excels(self.x, self.z, pic).write_excel(2, 11)
            sleep(10)

        except:
            info = str(sys.exc_info())
            Logs.logs(self.y, self.z, info)._writ_file()
    def InputCompanyInfo(self):
        print(
            '—————————————————————————————公司信息页面载入中,请稍后————————————————————————————'
        )
        rsl = excle.excels(self.x, 'Auto_mlrc_CompanyInfo_009',
                           "").searche_pth_excel()

        # 截图存档并写入excle
        pic = str(
            snapshots.captrue(self.m, self.z)._capture_creen_ini_(self.driver))

        print("请输入单位名称。。。。。")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/company_name_text")
        el.click()
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/et_info")
        el.clear()
        el.click()
        el.send_keys(self.company_name)
        self.driver.hide_keyboard()
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/title_right_custom")
        el.click()
        print("单位名称已输入")
        sleep(3)

        print("开始输入单位地址。。。。。")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/company_address_text")
        el.click()
        sleep(1)
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/item_content")
        el.click()
        sleep(1)
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/textView")
        el.click()
        sleep(2)
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/textView")
        el.click()
        sleep(2)
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/textView")
        el.click()
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/et_addr")
        el.click()
        el.send_keys(self.et_addr)
        self.driver.hide_keyboard()
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/title_right_custom")
        el.click()
        print("单位地址输入成功")
        sleep(3)

        print("开始输入单位电话。。。。。")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/company_mobile_edit")
        el.clear()
        el.click()
        el.send_keys(self.company_mobile)
        self.driver.hide_keyboard()
        print("单位电话已输入")
        sleep(3)

        print("开始选择职位。。。。。")
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/position_text")
        el.click()
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/wheel")
        el.click()

        # 往上翻动
        self.driver.swipe(400, 1000, 400, 800)
        self.driver.implicitly_wait(1000)

        el = self.driver.find_element_by_id('com.rjs.ddjr:id/done')
        el.click()
        print('职位已选择')
        sleep(3)

        print("开始输入部门。。。。。")
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/department_text")
        el.click()
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/et_info")
        el.clear()
        el.click()
        el.send_keys(self.department)
        self.driver.hide_keyboard()
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/title_right_custom")
        el.click()
        sleep(3)
        print("部门已经输入")

        print("开始选择起始服务时间")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/service_time_text")
        el.click()
        el = self.driver.find_element_by_id("android:id/numberpicker_input")
        el.click()

        # 分别在年月日上进行滑动选择
        self.driver.swipe(150, 980, 150, 1150)
        self.driver.swipe(150, 980, 150, 1150)
        self.driver.swipe(350, 980, 350, 1150)
        self.driver.swipe(350, 980, 350, 1150)
        self.driver.swipe(560, 980, 560, 1150)
        self.driver.swipe(560, 980, 560, 1150)

        el = self.driver.find_element_by_id("com.rjs.ddjr:id/done")
        el.click()
        print("起始服务时间已选择")
        sleep(3)

        print("开始输入每月收入。。。。。")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/monthly_income_edit")
        el.clear()
        el.click()
        el.send_keys(self.monthly_income)
        self.driver.hide_keyboard()
        print("每月收入已输入")
        sleep(3)

        # 往上翻动
        self.driver.swipe(400, 1100, 400, 800)
        self.driver.implicitly_wait(1000)

        print("开始选择每月发薪日。。。。。")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/monthly_pay_day_text")
        el.click()
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/wheel")

        # 往上翻动
        self.driver.swipe(400, 1000, 400, 800)
        self.driver.implicitly_wait(1000)
        el = self.driver.find_element_by_id('com.rjs.ddjr:id/done')
        el.click()
        print('每月发薪日已选择')
        sleep(3)

        print("开始选择支付方式。。。。。")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/payment_method_text")
        el.click()
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/wheel")
        el.click()

        # 往上翻动
        self.driver.swipe(400, 1000, 400, 800)
        self.driver.implicitly_wait(1000)
        el = self.driver.find_element_by_id('com.rjs.ddjr:id/done')
        el.click()
        print('支付方式已选择')
        sleep(3)

        # 往上翻动
        self.driver.swipe(400, 1100, 400, 800)
        self.driver.implicitly_wait(1000)

        print("开始选择工作证明类型。。。。。")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/work_certificate_text")
        el.click()
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/rb_1")
        el.click()
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/tv_confirm")
        el.click()

        # 开始上传工作证明照片
        self.driver.find_element_by_id("com.rjs.ddjr:id/iv_pic").click()
        self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        sleep(6)
        self.driver.find_element_by_id(
            "com.rjs.ddjr:id/title_right_custom").click()
        sleep(3)
        print("工作证明已上传")

        print("开始上传央行征信照片。。。。。")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/credit_report_text")
        el.click()

        # 开始上传央行征信照片
        self.driver.find_element_by_id("com.rjs.ddjr:id/iv_pic").click()
        self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        sleep(6)
        self.driver.find_element_by_id(
            "com.rjs.ddjr:id/title_right_custom").click()
        sleep(3)
        print("央行征信照片已上传")

        self.driver.find_element_by_id("com.rjs.ddjr:id/draft_save").click()
        sleep(1)
        print("——————————————————————————草稿录单模块,公司信息页面已保存!——————————————————")

        try:
            # 评审修改时间2017/5/4
            # 加入检查点,并最终判断case执行的结果是通过还是不通过
            self.driver.start_activity(
                'com.rjs.ddjr', 'com.rjs.ddjr.publicmodel.view.HomeActivity')

            # 去掉升级,点击【工作台】按钮,进入草稿录单页面
            # el = self.driver.find_element_by_id("android:id/button2")
            # el.click()
            sleep(1)
            el = self.driver.find_element_by_id(
                "com.rjs.ddjr:id/main_btn_message")
            el.click()
            el = self.driver.find_element_by_id("com.rjs.ddjr:id/draft")
            el.click()
            sleep(1)
            el = self.driver.find_element_by_id("com.rjs.ddjr:id/cheyidai_tab")
            el.click()
            el = self.driver.find_element_by_id(
                'com.rjs.ddjr:id/draft_item_name')
            print(el.text)
            if el.text == "suzhoutest":
                flag = 'P'
            if el.text != "suzhoutest":
                flag = 'F'
            print(flag)

            el = self.driver.find_element_by_id("com.rjs.ddjr:id/draft_layout")
            el.click()
            self.driver.find_element_by_id("com.rjs.ddjr:id/draft_company")
            el = self.driver.find_element_by_id(
                "com.rjs.ddjr:id/draft_company_progress")
            print(el.text)
            if el.text == "完成:100%":
                flag = "P"
            if el.text != "完成:100%":
                flag = "F"
            print(flag)

            # 将结果写入到case和log日志中
            logstr = str(self.driver.get_log("logcat"))
            excle.excels(self.x, self.z, flag).write_excel(rsl, 10)
            Logs.logs(self.y, self.z, flag)._writ_file()
            Logs.logs(self.y, 'logcat', logstr)._writ_file()

            excle.excels(self.x, self.z, pic).write_excel(2, 11)
            sleep(10)

        except:
            info = str(sys.exc_info())
            Logs.logs(self.y, self.z, info)._writ_file()
    def InputPersonalInfo(self):
        rsl = excle.excels(self.x, 'Auto_mlrc_Personinfo_002',
                           "").searche_pth_excel()

        # 截图存档并写入excle
        pic = str(
            snapshots.captrue(self.m, self.z)._capture_creen_ini_(self.driver))

        # 输入申请金额
        print('准备输入申请金额,请稍后。。。。。')
        el = self.driver.find_element_by_id('com.rjs.ddjr:id/loan_money_edit')
        el.click()
        el.send_keys(self.loan_money)
        print('申请金额已输入')
        sleep(3)

        # 输入申请期数
        print('准备输入申请期数,请稍后。。。。。')
        el = self.driver.find_element_by_id('com.rjs.ddjr:id/loan_period_text')
        el.click()
        self.driver.implicitly_wait(1000)
        # el = self.driver.find_element_by_id('com.rjs.ddjr:id/wheel')
        # el.click()

        # 往上翻动
        self.driver.swipe(400, 1000, 400, 800)
        self.driver.implicitly_wait(1000)

        el = self.driver.find_element_by_id('com.rjs.ddjr:id/done')
        el.click()
        print('申请期数已选择')
        sleep(3)

        # 选择职业身份
        print('准备选择职业身份,请稍后。。。。。')
        el = self.driver.find_element_by_id(
            'com.rjs.ddjr:id/professional_identity_text')
        el.click()
        el = self.driver.find_element_by_id('com.rjs.ddjr:id/wheel')
        el.click()

        # 执行第二种职业身份时,启动这段代码
        self.driver.swipe(400, 1000, 400, 900)
        self.driver.implicitly_wait(1000)

        # # 执行第三种职业身份时,启动这段代码
        # self.driver.swipe(400, 1000, 400, 800)
        # self.driver.implicitly_wait(1000)

        el = self.driver.find_element_by_id('com.rjs.ddjr:id/done')
        el.click()
        print('职业身份已选择')
        sleep(3)

        # 选择借款用途
        print('准备选择借款用途,请稍后。。。。。')
        el = self.driver.find_element_by_id('com.rjs.ddjr:id/loan_usage_text')
        el.click()
        el = self.driver.find_element_by_name('生意往来')
        el.click()
        print('借款用途已选择')
        sleep(3)

        # 选择是否投保履约险
        print('准备选择是否投保履约险,请稍后。。。。。')
        el = self.driver.find_element_by_id(
            'com.rjs.ddjr:id/loan_insurace_text')
        el.click()
        el = self.driver.find_element_by_id('com.rjs.ddjr:id/wheel')
        el.click()
        # 往上滑动
        self.driver.swipe(350, 1000, 350, 820)
        el = self.driver.find_element_by_id('com.rjs.ddjr:id/done')
        el.click()
        print('投保履约险已选择')

        # 上传身份证正面
        print('即将上传身份证正面照,请稍后。。。。。')
        el = self.driver.find_element_by_id('com.rjs.ddjr:id/positive_id_card')
        el.click()
        sleep(8)
        try:
            self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
            sleep(2)
            self.driver.find_element_by_id(
                'com.rjs.ddjr:id/action_done').click()
            sleep(10)
            print('身份证正面照上传成功!')
        except NoSuchElementException:
            pass
        finally:
            info = str(sys.exc_info())
            Logs.logs(self.y, self.z, info)._writ_file

        # 上传身份证反面
        print('即将上传身份证反面照,请稍后。。。。。')
        el = self.driver.find_element_by_id('com.rjs.ddjr:id/id_card_back')
        el.click()
        sleep(8)
        try:
            self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
            sleep(2)
            self.driver.find_element_by_id(
                'com.rjs.ddjr:id/action_done').click()
            print('身份证反面正在上传,请稍后...')
            sleep(10)
            print('身份证反面照上传成功!')
            # else:
            #     self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
            #     print('上传失败,请重新上传')
            #     sleep(6)
        except NoSuchElementException:
            pass
        finally:
            info = str(sys.exc_info())
            Logs.logs(self.y, self.z, info)._writ_file

        # 往下滑动一次
        print("开始往下滑动一次。。。。。。")
        self.driver.swipe(100, 500, 100, 100)
        sleep(3)

        print("开始输入姓名。。。。。")
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/person_name")
        el.clear()
        el.click()
        self.driver.implicitly_wait(100)
        el.send_keys(self.person_name)
        self.driver.hide_keyboard()
        print("姓名输入成功")
        sleep(3)

        print("开始选择性别。。。。。")
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/person_sex_text")
        el.click()
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/wheel")
        el.click()
        self.driver.swipe(350, 1000, 350, 820)
        self.driver.implicitly_wait(100)
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/done")
        el.click()
        print("性别选择成功")
        sleep(3)

        # 往下滑动一次
        print("开始往下滑动一次。。。。。")
        self.driver.swipe(100, 500, 100, 100)

        print("开始输入年龄。。。。。")
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/person_age")
        el.clear()
        el.click()
        el.send_keys(self.person_age)
        self.driver.hide_keyboard()
        print("年龄输入成功")
        sleep(3)

        print("开始选择出生日期。。。。。")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/date_of_birth_text")
        el.click()
        self.driver.implicitly_wait(100)
        el = self.driver.find_element_by_id("android:id/numberpicker_input")
        el.click()

        # 往下翻动,选择年份(年份越来越小)
        self.driver.swipe(140, 900, 140, 1160)
        self.driver.swipe(140, 900, 140, 1160)
        self.driver.swipe(140, 900, 140, 1160)
        self.driver.swipe(140, 900, 140, 1160)
        self.driver.swipe(140, 900, 140, 1160)
        self.driver.swipe(140, 900, 140, 1160)
        self.driver.swipe(140, 900, 140, 1160)
        self.driver.swipe(140, 900, 140, 1160)
        self.driver.swipe(140, 900, 140, 1160)
        self.driver.swipe(140, 900, 140, 1160)
        self.driver.swipe(140, 900, 140, 1160)
        self.driver.swipe(140, 900, 140, 1160)
        self.driver.swipe(140, 900, 140, 1160)
        self.driver.swipe(140, 900, 140, 1160)
        self.driver.swipe(140, 900, 140, 1160)
        self.driver.swipe(140, 900, 140, 1160)
        self.driver.swipe(140, 900, 140, 1160)
        self.driver.swipe(140, 900, 140, 1160)
        self.driver.swipe(140, 900, 140, 1160)

        el = self.driver.find_element_by_id("com.rjs.ddjr:id/done")
        el.click()
        print("日期选择成功")
        sleep(3)

        print("开始输入证件号码。。。。。")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/identification_number")
        el.clear()
        el.click()
        el.send_keys(self.identification_number)
        self.driver.hide_keyboard()
        print("证件号码输入完成")
        sleep(3)

        # 往下滑动一次
        print("开始往下滑动一次。。。。。。")
        self.driver.swipe(100, 500, 100, 100)

        print("开始选择身份证有效截止日期。。。。。")
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/valid_date_text")
        el.click()
        self.driver.implicitly_wait(100)
        el = self.driver.find_element_by_id("android:id/numberpicker_input")
        el.click()

        # 往上翻动,选择年份(年份越来越大)
        self.driver.swipe(140, 1000, 140, 880)
        self.driver.swipe(140, 1000, 140, 880)
        self.driver.swipe(140, 1000, 140, 880)
        self.driver.swipe(140, 1000, 140, 880)
        self.driver.swipe(140, 1000, 140, 880)
        self.driver.swipe(140, 1000, 140, 880)
        self.driver.swipe(140, 1000, 140, 880)
        self.driver.swipe(140, 1000, 140, 880)

        el = self.driver.find_element_by_id("com.rjs.ddjr:id/done")
        el.click()
        print("身份证有效截止日期选择完成")
        sleep(3)

        print("开始输入户籍地址。。。。。")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/permanent_address_text")
        el.click()
        sleep(1)
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/item_content")
        el.click()
        sleep(1)
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/textView")
        el.click()
        sleep(2)
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/textView")
        el.click()
        sleep(2)
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/textView")
        el.click()
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/et_addr")
        el.click()
        el.send_keys(self.et_addr)
        self.driver.hide_keyboard()
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/title_right_custom")
        el.click()
        print("户籍地址输入成功")
        sleep(3)

        # 往下滑动一次
        print("开始往下滑动一次。。。。。")
        self.driver.swipe(100, 500, 100, 100)

        print("开始选择婚姻状态。。。。。")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/marital_status_text")
        el.click()
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/wheel")
        el.click()

        # 往上翻动
        self.driver.swipe(400, 1000, 400, 800)
        self.driver.implicitly_wait(100)

        el = self.driver.find_element_by_id("com.rjs.ddjr:id/done")
        el.click()

        print("开始输入住宅地址。。。。。")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/residential_address_text")
        el.click()
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/cb_asCardAddr")
        el.click()
        print("住宅地址输入成功")
        sleep(3)

        # 往下滑动一次
        print("开始往下滑动一次。。。。。。")
        self.driver.swipe(100, 500, 100, 100)

        print("开始输入移动电话。。。。。")
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/person_phone")
        el.clear()
        el.click()
        el.send_keys(self.person_phone)
        self.driver.hide_keyboard()
        print("移动电话输入成功")
        sleep(3)

        self.driver.swipe(100, 500, 100, 100)

        # 新版本已经取消了这几个字段
        # print("开始输入服务密码。。。。。")
        # el = self.driver.find_element_by_id("com.rjs.ddjr:id/phone_number_service_password")
        # el.clear()
        # el.click()
        # el.send_keys(self.phone_number_service_password)
        # self.driver.hide_keyboard()
        # print("服务密码输入成功")
        # sleep(3)
        #
        # print("开始输入住宅电话。。。")
        # el = self.driver.find_element_by_id("com.rjs.ddjr:id/home_phone")
        # el.clear()
        # el.click()
        # el.send_keys(self.home_phone)
        # self.driver.hide_keyboard()
        # print("住宅电话输入成功")
        # sleep(3)

        # 往下滑动一次
        print("开始往下滑动一次。。。。。")
        self.driver.swipe(100, 500, 100, 100)

        print("开始输入邮箱地址。。。。。")
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/mail_address")
        el.clear()
        el.click()
        el.send_keys(self.mail_address)
        self.driver.hide_keyboard()
        print("邮箱地址输入成功")
        sleep(3)

        print("开始输入微信或者QQ。。。。。")
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/qq_number")
        el.clear()
        el.click()
        el.send_keys(self.qq_number)
        self.driver.hide_keyboard()
        print("微信或者QQ输入成功")
        sleep(3)

        print("开始选择学历。。。。。")
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/education_text")
        el.click()
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/wheel")
        el.click()

        # 往下滑动
        self.driver.swipe(350, 1000, 350, 820)
        self.driver.swipe(350, 1000, 350, 820)

        el = self.driver.find_element_by_id("com.rjs.ddjr:id/done")
        el.click()
        print("学历已选择")
        sleep(3)

        # 往下滑动一次
        print("开始往下滑动一次。。。。。")
        self.driver.swipe(100, 500, 100, 100)

        print("开始选择来本地时间。。。。。")
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/local_time_text")
        el.click()
        el = self.driver.find_element_by_id("android:id/numberpicker_input")
        el.click()

        # 分别在年月日上进行滑动选择
        self.driver.swipe(150, 980, 150, 1150)
        self.driver.swipe(150, 980, 150, 1150)
        self.driver.swipe(350, 980, 350, 1150)
        self.driver.swipe(350, 980, 350, 1150)
        self.driver.swipe(560, 980, 560, 1150)
        self.driver.swipe(560, 980, 560, 1150)

        el = self.driver.find_element_by_id("com.rjs.ddjr:id/done")
        el.click()
        print("来本地时间已选择")
        sleep(3)

        print("开始输入起始居住时间。。。。。")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/initial_residence_time_text")
        el.click()
        el = self.driver.find_element_by_id("android:id/numberpicker_input")
        el.click()

        # 分别在年月日上进行滑动选择
        self.driver.swipe(150, 980, 150, 1150)
        self.driver.swipe(150, 980, 150, 1150)
        self.driver.swipe(350, 980, 350, 1150)
        self.driver.swipe(350, 980, 350, 1150)
        self.driver.swipe(560, 980, 560, 1150)
        self.driver.swipe(560, 980, 560, 1150)

        el = self.driver.find_element_by_id("com.rjs.ddjr:id/done")
        el.click()
        print("起始居住时间已选择")
        sleep(3)

        print("开始选择居住类别。。。。。")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/residential_category_text")
        el.click()
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/wheel")
        el.click()

        # 往下滑动
        self.driver.swipe(350, 1000, 350, 820)
        self.driver.swipe(350, 1000, 350, 820)

        el = self.driver.find_element_by_id("com.rjs.ddjr:id/done")
        el.click()
        print("居住类别请选择")

        print("即将保存个人信息页面。。。。。")
        sleep(2)
        self.driver.find_element_by_id('com.rjs.ddjr:id/draft_save').click()
        print("草稿录单模块,个人信息页面保存成功!")

        try:
            # 评审修改时间2017/5/4
            # 加入检查点,并最终判断case执行的结果是通过还是不通过
            self.driver.start_activity(
                'com.rjs.ddjr', 'com.rjs.ddjr.publicmodel.view.HomeActivity')

            # 去掉升级,点击【工作台】按钮,进入草稿录单页面
            # el = self.driver.find_element_by_id("android:id/button2")
            # el.click()
            sleep(1)
            el = self.driver.find_element_by_id(
                "com.rjs.ddjr:id/main_btn_message")
            el.click()
            el = self.driver.find_element_by_id("com.rjs.ddjr:id/draft")
            el.click()
            sleep(1)
            el = self.driver.find_element_by_id("com.rjs.ddjr:id/cheyidai_tab")
            el.click()
            el = self.driver.find_element_by_id(
                'com.rjs.ddjr:id/draft_item_name')
            print(el.text)
            if el.text == "suzhoutest":
                flag = 'P'
            if el.text != "suzhoutest":
                flag = 'F'
            print(flag)

            el = self.driver.find_element_by_id("com.rjs.ddjr:id/draft_layout")
            el.click()
            self.driver.find_element_by_id("com.rjs.ddjr:id/draft_personal")
            el = self.driver.find_element_by_id(
                "com.rjs.ddjr:id/draft_personal_progress")
            print(el.text)
            if el.text == "完成:100%":
                flag = "P"
            if el.text != "完成:100%":
                flag = "F"
            print(flag)

            # 将结果写入到case和log日志中
            logstr = str(self.driver.get_log("logcat"))
            excle.excels(self.x, self.z, flag).write_excel(rsl, 10)
            Logs.logs(self.y, self.z, flag)._writ_file()
            Logs.logs(self.y, 'logcat', logstr)._writ_file()

            excle.excels(self.x, self.z, pic).write_excel(2, 11)
            sleep(10)

        except:
            info = str(sys.exc_info())
            Logs.logs(self.y, self.z, info)._writ_file()
Exemplo n.º 10
0
    def InputVehicleInfo(self):
        print(
            '—————————————————————————————车辆信息页面载入中,请稍后————————————————————————————'
        )
        rsl = excle.excels(self.x, 'Auto_mlrc_VehicleInfo_004',
                           "").searche_pth_excel()

        # 截图存档并写入excle
        pic = str(
            snapshots.captrue(self.m, self.z)._capture_creen_ini_(self.driver))

        print('开始上传行驶证主页')
        self.driver.find_element_by_id(
            "com.rjs.ddjr:id/driving_license_page").click()
        # self.driver.implicitly_wait(3)
        print("开始勾选图片,进行上传。。。。。")
        # self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        self.driver.find_element_by_xpath(
            "//android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.widget.RelativeLayout[1]/android.support.v7.widget.RecyclerView[1]/android.widget.RelativeLayout[2]/android.widget.ImageView[2]"
        ).click()
        self.driver.implicitly_wait(3)
        self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        self.driver.implicitly_wait(10)
        print('行驶证主页上传成功!')

        print("开始输入车牌")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/license_plate_text")
        el.click()
        # 选择代号
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/tv_1")
        el.click()
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/tv_item_filter")
        el.click()
        # 选择字母
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/tv_2")
        el.click()
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/tv_item_filter")
        el.click()
        # 选择号码
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/et_num")
        el.clear()
        el.click()

        # 随机读取车牌号,并写入到字段中
        license_random = random.randint(10000, 999999)
        print(license_random)
        el.send_keys(license_random)

        self.driver.hide_keyboard()
        # 保存车牌
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/title_right_custom")
        el.click()
        print("车牌号码已输入")
        self.driver.implicitly_wait(1)

        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/registration_date_text")
        el.click()
        print("开始选择注册日期。。。。。")
        el = self.driver.find_element_by_id("android:id/numberpicker_input")
        el.click()

        # 往下翻动,选择年份(年份越来越小)
        self.driver.swipe(140, 1000, 140, 1160)
        # self.driver.swipe(360, 1000, 360, 1160)
        # self.driver.swipe(560, 1000, 560, 1160)
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/done")
        el.click()
        print("注册日期已选择")
        self.driver.implicitly_wait(1)

        print("开始选择发证日期。。。。。")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/date_of_issue_text")
        el.click()
        # self.driver.implicitly_wait(1)
        el = self.driver.find_element_by_id("android:id/numberpicker_input")
        el.click()
        # 往下翻动,选择年份(年份越来越小)
        self.driver.swipe(140, 1000, 140, 1160)
        # self.driver.swipe(360, 1000, 360, 1160)
        # self.driver.swipe(560, 1000, 560, 1160)
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/done")
        el.click()
        print("发证日期已选择")
        self.driver.implicitly_wait(1)

        print('开始输入车辆识别码')
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/vehicle_identification_code_edit")
        el.clear()
        el.click()
        el.send_keys(self.vehicle_identification_code)
        self.driver.hide_keyboard()
        print('车辆识别码已输入')
        self.driver.implicitly_wait(1)

        print('开始输入发送机号码')
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/engine_number_edit")
        el.clear()
        el.click()
        el.send_keys(self.engine_number)
        self.driver.hide_keyboard()
        print('发动机号码已选择')
        self.driver.implicitly_wait(1)

        print('开始输入车辆类型')
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/vehicle_type_edit")
        el.clear()
        el.click()
        el.send_keys(self.vehicle_type)
        self.driver.hide_keyboard()
        print('车辆类型已输入')
        self.driver.implicitly_wait(1)

        # 往下滑动一次
        self.driver.swipe(300, 1000, 300, 500)
        self.driver.swipe(300, 1000, 300, 500)

        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/driving_vice_text")
        el.click()
        print("开始点击行驶证副页,进行上传。。。。。")
        self.driver.find_element_by_id("com.rjs.ddjr:id/iv_pic").click()
        self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        self.driver.implicitly_wait(6)
        self.driver.find_element_by_id(
            'com.rjs.ddjr:id/title_right_custom').click()
        print('行驶证副页上传成功!')
        self.driver.implicitly_wait(1)

        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/vehicle_registration_certificate_text")
        el.click()
        print("开始点击车辆登记证,进行上传。。。。。")
        self.driver.find_element_by_id("com.rjs.ddjr:id/iv_pic").click()
        self.driver.implicitly_wait(2)
        self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        self.driver.implicitly_wait(6)
        self.driver.find_element_by_id(
            'com.rjs.ddjr:id/title_right_custom').click()
        print('车辆登记证上传成功!')
        self.driver.implicitly_wait(1)

        print("开始选择车系品牌")
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/car_text")
        el.click()
        el = self.driver.find_element_by_name("AC Schnitzer")
        el.click()
        self.driver.implicitly_wait(1)
        el = self.driver.find_element_by_name("AC Schnitzer Eagle")
        el.click()
        print('车系品牌已选择')
        self.driver.implicitly_wait(1)

        print("开始选择车辆归属")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/vehicle_ownership_text")
        el.click()
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/wheel")
        el.click()
        # # 往上滑动
        # self.driver.swipe(400, 1000, 400, 800)
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/done")
        el.click()
        print('车辆归属已选择')
        self.driver.implicitly_wait(1)

        print("开始选择购车时间")
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/buying_time_text")
        el.click()
        el = self.driver.find_element_by_id("android:id/numberpicker_input")
        el.click()

        # # 往下翻动,选择年份(年份越来越小)
        # self.driver.swipe(140, 1000, 140, 1160)
        # self.driver.swipe(360, 1000, 360, 1160)
        # self.driver.swipe(560, 1000, 560, 1160)
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/done")
        el.click()
        print('购车时间已选择')
        self.driver.implicitly_wait(1)

        print("开始选择初次登记时间")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/initial_registration_time_text")
        el.click()
        el = self.driver.find_element_by_id("android:id/numberpicker_input")
        el.click()

        # # 往下翻动,选择年份(年份越来越小)
        # self.driver.swipe(140, 1000, 140, 1160)
        # self.driver.swipe(360, 1000, 360, 1160)
        # self.driver.swipe(560, 1000, 560, 1160)
        el = self.driver.find_element_by_id("com.rjs.ddjr:id/done")
        el.click()
        print('初次登记时间已选择')
        self.driver.implicitly_wait(1)

        print("输入购买价格")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/purchase_price_edit")
        el.clear()
        el.click()
        el.send_keys(self.purchase_price)
        self.driver.hide_keyboard()
        print("购买价格输入完成")
        self.driver.implicitly_wait(1)

        print("输入一年内抵押次数")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/mortgage_number_edit")
        el.clear()
        el.click()
        el.send_keys(self.mortgage_number)
        self.driver.hide_keyboard()
        print("一年内抵押次数输入完成")
        self.driver.implicitly_wait(1)

        print("开始选择交强险保单合同")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/contract_of_insurance_text")
        el.click()
        print("开始点击交强险保单合同,进行上传。。。。。")
        self.driver.find_element_by_id("com.rjs.ddjr:id/iv_pic").click()
        self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        self.driver.implicitly_wait(6)
        self.driver.find_element_by_id(
            'com.rjs.ddjr:id/title_right_custom').click()
        print('交强险保单合同上传成功!')
        self.driver.implicitly_wait(1)

        print("开始选择商业险保单合同")
        el = self.driver.find_element_by_id(
            "com.rjs.ddjr:id/commercial_insurance_contract_text")
        el.click()
        print("开始点击商业险保单合同,进行上传。。。。。")
        self.driver.find_element_by_id("com.rjs.ddjr:id/iv_pic").click()
        self.driver.find_element_by_id('com.rjs.ddjr:id/cbx').click()
        self.driver.find_element_by_id('com.rjs.ddjr:id/action_done').click()
        self.driver.implicitly_wait(6)
        self.driver.find_element_by_id(
            'com.rjs.ddjr:id/title_right_custom').click()
        print('商业险保单合同上传成功!')
        self.driver.implicitly_wait(1)
        self.driver.find_element_by_id("com.rjs.ddjr:id/next_step").click()
        # self.driver.implicitly_wait(1)
        print("——————————————————————————草稿录单模块,车辆信息页面已保存!——————————————————")