Example #1
0
class GetData:
    def __init__(self, file_name=None, sheet_id=None):
        self.file_name = file_name
        self.sheet_id = sheet_id
        self.opera_excel = OperationExcel(self.file_name, self.sheet_id)  #实例化
        self.global_var = GlobalVar()  #实例化

    #去获取excel行数,就是我们的case个数
    def get_case_lines(self):
        return self.opera_excel.get_lines()

    # 获取id
    def get_id(self, row):
        col = int(self.global_var.id)  #获取id所在的列数
        id = self.opera_excel.get_cell_value(row, col)  #获取指定单元格的内容
        return id

    # 获取answer_comments
    def get_answer_comments(self, row):
        col = int(self.global_var.answer_comments)  #获取answer_comments所在的列数
        answer_comments = self.opera_excel.get_cell_value(row,
                                                          col)  #获取指定单元格的内容
        return answer_comments
Example #2
0
class GetData:
    def __init__(self, file_name=None, sheet_id=None):
        self.file_name = file_name
        self.sheet_id = sheet_id
        self.opera_excel = OperationExcel(self.file_name, self.sheet_id)  #实例化
        self.global_var = GlobalVar()  #实例化

    #去获取excel行数,就是我们的case个数
    def get_case_lines(self):
        return self.opera_excel.get_lines()

    # 获取id
    def get_id(self, row):
        col = int(self.global_var.id)  #获取id所在的列数
        id = self.opera_excel.get_cell_value(row, col)  #获取指定单元格的内容
        return id

    # 获取webproject
    def get_webproject(self, row):
        col = int(self.global_var.webproject)  #获取webproject所在的列数
        webproject = self.opera_excel.get_cell_value(row, col)  #获取指定单元格的内容
        return webproject

    #获取testpage
    def get_testpage(self, row):
        col = int(self.global_var.testpage)  #获取testpage所在的列数
        testpage = self.opera_excel.get_cell_value(row, col)  #获取指定单元格的内容
        return testpage

    # 获取testcasetitle
    def get_testcasetitle(self, row):
        col = int(self.global_var.testcasetitle)  #获取testcasetitle所在的列数
        testcasetitle = self.opera_excel.get_cell_value(row, col)  #获取指定单元格的内容
        return testcasetitle

    # 获取isclicklastpage
    def get_isclicklastpage(self, row):
        col = int(self.global_var.isclicklastpage)  #获取isclicklastpage所在的列数
        isclicklastpage = self.opera_excel.get_cell_value(row,
                                                          col)  #获取指定单元格的内容
        if isclicklastpage == "TRUE":
            return "1"
        elif isclicklastpage == "True":
            return "1"
        elif isclicklastpage == "true":
            return "1"
        elif isclicklastpage == u"是":
            return "1"
        elif isclicklastpage == u"点击":
            return "1"
        elif isclicklastpage == "FALSE":
            return "0"
        elif isclicklastpage == "False":
            return "0"
        elif isclicklastpage == "false":
            return "0"
        elif isclicklastpage == u"否":
            return "0"
        elif isclicklastpage == u"不是":
            return "0"
        elif isclicklastpage == u"不点击":
            return "0"
        return isclicklastpage

    # 获取selectxpath
    def get_selectxpath(self, row):
        col = int(self.global_var.selectxpath)  #获取selectxpath所在的列数
        selectxpath = self.opera_excel.get_cell_value(row, col)  #获取指定单元格的内容
        if selectxpath == u"空":
            return None
        elif selectxpath == "":
            return None
        elif selectxpath == " ":
            return None
        return selectxpath

    #获取selectoptiontextxpath
    def get_selectoptiontextxpath(self, row):
        col = int(self.global_var.selectoptiontextxpath
                  )  #获取selectoptiontextxpath所在的列数
        selectoptiontextxpath = self.opera_excel.get_cell_value(
            row, col)  #获取指定单元格的内容
        if selectoptiontextxpath == u"空":
            return None
        elif selectoptiontextxpath == "":
            return None
        elif selectoptiontextxpath == " ":
            return None
        return selectoptiontextxpath

    # 获取selectinputxpath
    def get_selectinputxpath(self, row):
        col = int(self.global_var.selectinputxpath)  #获取selectinputxpath所在的列数
        selectinputxpath = self.opera_excel.get_cell_value(row,
                                                           col)  #获取指定单元格的内容
        if selectinputxpath == u"空":
            return None
        elif selectinputxpath == "":
            return None
        elif selectinputxpath == " ":
            return None
        return selectinputxpath

    # 获取selectinputselectonexpath
    def get_selectinputselectonexpath(self, row):
        col = int(self.global_var.selectinputselectonexpath
                  )  #获取selectinputselectonexpath所在的列数
        selectinputselectonexpath = self.opera_excel.get_cell_value(
            row, col)  #获取指定单元格的内容
        if selectinputselectonexpath == u"空":
            return None
        elif selectinputselectonexpath == "":
            return None
        elif selectinputselectonexpath == " ":
            return None
        return selectinputselectonexpath

    # 获取selectinputtext
    def get_selectinputtext(self, row):
        col = int(self.global_var.selectinputtext)  #获取selectinputtext所在的列数
        selectinputtext = self.opera_excel.get_cell_value(row,
                                                          col)  #获取指定单元格的内容
        if selectinputtext == u"空":
            return None
        elif selectinputtext == "":
            return None
        elif selectinputtext == " ":
            return None
        return selectinputtext

    #获取isfind
    def get_isfind(self, row):
        col = int(self.global_var.isfind)  #获取isfind所在的列数
        isfind = self.opera_excel.get_cell_value(row, col)  #获取指定单元格的内容
        if isfind == "TRUE":
            return "1"
        elif isfind == "True":
            return "1"
        elif isfind == "true":
            return "1"
        elif isfind == u"是":
            return "1"
        elif isfind == u"有":
            return "1"
        elif isfind == "FALSE":
            return "0"
        elif isfind == "False":
            return "0"
        elif isfind == "false":
            return "0"
        elif isfind == u"否":
            return "0"
        elif isfind == u"没有":
            return "0"
        return isfind

    # 获取colnum
    def get_colnum(self, row):
        col = int(self.global_var.colnum)  #获取colnum所在的列数
        colnum = self.opera_excel.get_cell_value(row, col)  #获取指定单元格的内容
        return colnum

    # 获取checktext
    def get_checktext(self, row):
        col = int(self.global_var.checktext)  #获取checktext所在的列数
        checktext = self.opera_excel.get_cell_value(row, col)  #获取指定单元格的内容
        return checktext
Example #3
0
 def __init__(self, file_name=None, sheet_id=None):
     self.file_name = file_name
     self.sheet_id = sheet_id
     self.opera_excel = OperationExcel(self.file_name, self.sheet_id)  #实例化
     self.global_var = GlobalVar()  #实例化
Example #4
0
class GetData:
    def __init__(self, file_name=None, sheet_id=None):
        self.file_name = file_name
        self.sheet_id = sheet_id
        self.opera_excel = OperationExcel(self.file_name, self.sheet_id)  #实例化
        self.global_var = GlobalVar()  #实例化

    #去获取excel行数,就是我们的case个数
    def get_case_lines(self):
        return self.opera_excel.get_lines()

    # 获取id
    def get_id(self, row):
        col = int(self.global_var.id)  #获取id所在的列数
        id = self.opera_excel.get_cell_value(row, col)  #获取指定单元格的内容
        return id

    # 获取testproject
    def get_testproject(self, row):
        col = int(self.global_var.testproject)  #获取testproject所在的列数
        testproject = self.opera_excel.get_cell_value(row, col)  #获取指定单元格的内容
        return testproject

    # 获取testmodule
    def get_testmodule(self, row):
        col = int(self.global_var.testmodule)  #获取testmodule所在的列数
        testmodule = self.opera_excel.get_cell_value(row, col)  #获取指定单元格的内容
        return testmodule

    #获取testpage
    def get_testpage(self, row):
        col = int(self.global_var.testpage)  #获取testpage所在的列数
        testpage = self.opera_excel.get_cell_value(row, col)  #获取指定单元格的内容
        return testpage

    # 获取testcasetitle
    def get_testcasetitle(self, row):
        col = int(self.global_var.testcasetitle)  #获取testcasetitle所在的列数
        testcasetitle = self.opera_excel.get_cell_value(row, col)  #获取指定单元格的内容
        return testcasetitle

    # 获取isinput
    def get_isinput(self, row):
        col = int(self.global_var.isinput)  #获取isinput所在的列数
        isinput = self.opera_excel.get_cell_value(row, col)  #获取指定单元格的内容
        if isinput == "TRUE":
            return "1"
        elif isinput == "True":
            return "1"
        elif isinput == "true":
            return "1"
        elif isinput == u"是":
            return "1"
        elif isinput == u"输入":
            return "1"
        elif isinput == "FALSE":
            return "0"
        elif isinput == "False":
            return "0"
        elif isinput == "false":
            return "0"
        elif isinput == u"否":
            return "0"
        elif isinput == u"不是":
            return "0"
        elif isinput == u"不输入":
            return "0"
        return isinput

    # 获取inputxpath
    def get_inputxpath(self, row):
        col = int(self.global_var.inputxpath)  #获取inputxpath所在的列数
        inputxpath = self.opera_excel.get_cell_value(row, col)  #获取指定单元格的内容
        if inputxpath == u"空":
            return None
        elif inputxpath == "":
            return None
        elif inputxpath == " ":
            return None
        return inputxpath

    #获取inputtext
    def get_inputtext(self, row):
        col = int(self.global_var.inputtext)  #获取inputtext所在的列数
        inputtext = self.opera_excel.get_cell_value(row, col)  #获取指定单元格的内容
        if inputtext == u"空":
            return None
        elif inputtext == "":
            return None
        elif inputtext == " ":
            return None
        return inputtext

    # 获取inputtipxpath
    def get_inputtipxpath(self, row):
        col = int(self.global_var.inputtipxpath)  #获取inputtipxpath所在的列数
        inputtipxpath = self.opera_excel.get_cell_value(row, col)  #获取指定单元格的内容
        if inputtipxpath == u"空":
            return None
        elif inputtipxpath == "":
            return None
        elif inputtipxpath == " ":
            return None
        return inputtipxpath

    # 获取inputtiptext
    def get_inputtiptext(self, row):
        col = int(self.global_var.inputtiptext)  #获取inputtiptext所在的列数
        inputtiptext = self.opera_excel.get_cell_value(row, col)  #获取指定单元格的内容
        if inputtiptext == u"空":
            return None
        elif inputtiptext == "":
            return None
        elif inputtiptext == " ":
            return None
        return inputtiptext
Example #5
0
class GetData:
    def __init__(self,file_name=None,sheet_id=None):
        self.file_name = file_name
        self.sheet_id = sheet_id
        self.opera_excel = OperationExcel(self.file_name,self.sheet_id)   #实例化
        self.global_var = GlobalVar()   #实例化


    #去获取excel行数,就是我们的case个数
    def get_case_lines(self):
        return self.opera_excel.get_lines()

    # 获取id
    def get_id(self,row):
        col = int(self.global_var.id)  #获取id所在的列数
        id = self.opera_excel.get_cell_value(row, col)   #获取指定单元格的内容
        return id

    # 获取test_project
    def get_test_project(self,row):
        col = int(self.global_var.test_project)  #获取test_project所在的列数
        test_project = self.opera_excel.get_cell_value(row, col)   #获取指定单元格的内容
        return test_project

    #获取test_module
    def get_test_module(self,row):
        col = int(self.global_var.test_module)  #获取test_module所在的列数
        test_module = self.opera_excel.get_cell_value(row, col)   #获取指定单元格的内容
        return test_module

    # 获取test_page
    def get_test_page(self,row):
        col = int(self.global_var.test_page)  #获取test_page所在的列数
        test_page = self.opera_excel.get_cell_value(row, col)   #获取指定单元格的内容
        return test_page

    # 获取requirement_function
    def get_requirement_function(self,row):
        col = int(self.global_var.requirement_function)  #获取requirement_function所在的列数
        requirement_function = self.opera_excel.get_cell_value(row, col)   #获取指定单元格的内容
        return requirement_function

    # 获取case_priority
    def get_case_priority(self,row):
        col = int(self.global_var.case_priority)  #获取case_priority所在的列数
        case_priority = self.opera_excel.get_cell_value(row, col)   #获取指定单元格的内容
        return case_priority

    #获取case_process_type
    def get_case_process_type(self,row):
        col = int(self.global_var.case_process_type)  #获取case_process_type所在的列数
        case_process_type = self.opera_excel.get_cell_value(row, col)   #获取指定单元格的内容
        return case_process_type

    # 获取rele_case
    def get_rele_case(self,row):
        col = int(self.global_var.rele_case)  #获取rele_case所在的列数
        rele_case = self.opera_excel.get_cell_value(row, col)   #获取指定单元格的内容
        return rele_case

    # 获取case_title
    def get_case_title(self,row):
        col = int(self.global_var.case_title)  #获取case_title所在的列数
        case_title = self.opera_excel.get_cell_value(row, col)   #获取指定单元格的内容
        return case_title

    # 获取case_precondition
    def get_case_precondition(self,row):
        col = int(self.global_var.case_precondition)  #获取case_precondition所在的列数
        case_precondition = self.opera_excel.get_cell_value(row, col)   #获取指定单元格的内容
        return case_precondition

    #获取case_step
    def get_case_step(self,row):
        col = int(self.global_var.case_step)  #获取case_step所在的列数
        case_step = self.opera_excel.get_cell_value(row, col)   #获取指定单元格的内容
        return case_step

    # 获取case_expected_result
    def get_case_expected_result(self,row):
        col = int(self.global_var.case_expected_result)  #获取case_expected_result所在的列数
        case_expected_result = self.opera_excel.get_cell_value(row, col)   #获取指定单元格的内容
        return case_expected_result

    # 获取write_comments
    def get_write_comments(self,row):
        col = int(self.global_var.write_comments)  #获取write_comments所在的列数
        write_comments = self.opera_excel.get_cell_value(row, col)   #获取指定单元格的内容
        return write_comments

    # 获取answer_comments
    def get_answer_comments(self,row):
        col = int(self.global_var.answer_comments)  #获取answer_comments所在的列数
        answer_comments = self.opera_excel.get_cell_value(row, col)   #获取指定单元格的内容
        return answer_comments

    # 获取write_user
    def get_write_user(self,row):
        col = int(self.global_var.write_user)  #获取write_user所在的列数
        write_user = self.opera_excel.get_cell_value(row, col)   #获取指定单元格的内容
        return write_user

    #获取write_case_time
    def get_write_case_time(self,row):
        col = int(self.global_var.write_case_time)  #获取write_case_time所在的列数
        write_case_time = self.opera_excel.get_cell_value(row, col)   #获取指定单元格的内容
        return write_case_time

    # 获取ex_result
    def get_ex_result(self,row):
        col = int(self.global_var.ex_result)  #获取ex_result所在的列数
        ex_result = self.opera_excel.get_cell_value(row, col)   #获取指定单元格的内容
        return ex_result

    #获取write_case_time
    def get_test_comments(self,row):
        col = int(self.global_var.test_comments)  #获取test_comments所在的列数
        test_comments = self.opera_excel.get_cell_value(row, col)   #获取指定单元格的内容
        return test_comments

    # 获取test_user
    def get_test_user(self,row):
        col = int(self.global_var.test_user)  #获取test_user所在的列数
        test_user = self.opera_excel.get_cell_value(row, col)   #获取指定单元格的内容
        return test_user