当前位置: 首页>>代码示例>>Python>>正文


Python BuiltIn._get_text方法代码示例

本文整理汇总了Python中robot.libraries.BuiltIn.BuiltIn._get_text方法的典型用法代码示例。如果您正苦于以下问题:Python BuiltIn._get_text方法的具体用法?Python BuiltIn._get_text怎么用?Python BuiltIn._get_text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在robot.libraries.BuiltIn.BuiltIn的用法示例。


在下文中一共展示了BuiltIn._get_text方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: table_get_column_no

# 需要导入模块: from robot.libraries.BuiltIn import BuiltIn [as 别名]
# 或者: from robot.libraries.BuiltIn.BuiltIn import _get_text [as 别名]
 def table_get_column_no(self, table_locator, columnName):
     """Returns the column number of the column matching 'columnName' from the table located at 'table_locator'."""
     #try:
     selenium = BuiltIn().get_library_instance('Selenium2Library')
     colCount = int(selenium.get_matching_xpath_count(table_locator+'/div[contains(@class,"dgrid-header dgrid-header-row")]/table[contains(@id,"-header")]/tr/th'))
     print "colCount:"+str(colCount)
     for iCounter in range(1,colCount+1):
         curColName = selenium._get_text(table_locator+'//div[contains(@class,"dgrid-header dgrid-header-row")]/table[contains(@id,"-header")]/tr/th['+str(iCounter)+']')
         if (curColName.replace(' ','').strip().lower()==columnName.replace(' ','').strip().lower()):
             print "column name matched at "+str(iCounter)
             return iCounter
     return 0
开发者ID:Tenxlabsmm,项目名称:Demo,代码行数:14,代码来源:CommonLibrary.py

示例2: get_table_cell_value

# 需要导入模块: from robot.libraries.BuiltIn import BuiltIn [as 别名]
# 或者: from robot.libraries.BuiltIn.BuiltIn import _get_text [as 别名]
 def get_table_cell_value(self, table_locator, rowNo, colName):
     "Returns the text located in the table 'table_locator' with in the Column 'columnName' and matching Row 'iRowNo'" ""
     selenium = BuiltIn().get_library_instance("Selenium2Library")
     colNo = self.table_get_column_no(table_locator, colName)
     return selenium._get_text(
         table_locator
         + '/div[@class="dgrid-scroller"]/div[contains(@class,"dgrid-content")]//div[contains(@id,"-row")]['
         + str(rowNo)
         + ']/table/tr/td[contains(@class,"dgrid-cell")]['
         + str(colNo)
         + "]"
     )
开发者ID:Tenxlabsmm,项目名称:Demo,代码行数:14,代码来源:CommonLibrary.py

示例3: get_table_values_into_list

# 需要导入模块: from robot.libraries.BuiltIn import BuiltIn [as 别名]
# 或者: from robot.libraries.BuiltIn.BuiltIn import _get_text [as 别名]
 def get_table_values_into_list(self, locator, columnName):
     """Returns the list of values displayed under 'columnName' from the table located at 'locator' """
     selenium = BuiltIn().get_library_instance('Selenium2Library')
     #Get the column number
     iColNo = self.table_get_column_no(locator,columnName)
     #Get the Number of Records in the Table
     elements = selenium.get_matching_xpath_count(locator+'/div[@class="dgrid-scroller"]/div[contains(@class,"dgrid-content")]//div[contains(@id,"-row")]')
     print "elements:"+str(elements)
     rowValues = []
     #Get the values from the records
     for ele in range(1,int(elements)+1):
         cellValue = selenium._get_text(locator+'/div[@class="dgrid-scroller"]/div[contains(@class,"dgrid-content")]//div[contains(@id,"-row")]['+str(ele)+']/table/tr/td[contains(@class,"dgrid-cell")]['+str(iColNo)+']')
         rowValues.append(cellValue)
     return rowValues                 
开发者ID:Tenxlabsmm,项目名称:Demo,代码行数:16,代码来源:CommonLibrary.py


注:本文中的robot.libraries.BuiltIn.BuiltIn._get_text方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。