示例#1
0
 def get_facts_value_by_name(self, facts_name):
     if RHSMGuiLocator().get_os_serials() == "6":
         for row in range(ldtp.getrowcount(RHSMGuiLocator().get_locator("system-facts-dialog"), RHSMGuiLocator().get_locator("facts-view-table"))):
             if(ldtp.getcellvalue(RHSMGuiLocator().get_locator("system-facts-dialog"), RHSMGuiLocator().get_locator("facts-view-table"), row, 0).strip() == facts_name):
                 logger.info("get_facts_value_by_name")
                 return ldtp.getcellvalue(RHSMGuiLocator().get_locator("system-facts-dialog"), RHSMGuiLocator().get_locator("facts-view-table"), row, 1)
         raise FailException("Test Failed - Failed to get_facts_value_by_name.")
示例#2
0
def check_small_business_integrity():
    if (ldtp.getrowcount(main_window, 'tblTableContent') != 9):
        raise ldtp.LdtpExecutionError(
            "Newly created database does not contain all 8 rows"
        )  # Note there is one placeholder row

    ldtp.selecttab(main_window, 'ptlListOrDetailsView', 'Details')
示例#3
0
文件: ldtpd.py 项目: fsharath/rhsm-qe
 def _quickgettablerowindex(self, window, table, target):
   numrows = ldtp.getrowcount(window, table)
   for i in range(0,numrows):
     try:
       value = ldtp.getcellvalue(window, table, i, 0)
       if self._matches(target,value):
         ldtp.selectrowindex(window, table, i)
         return i
     except:
       continue
   raise Exception("Item not found in table!")
示例#4
0
文件: ldtpd.py 项目: fsharath/rhsm-qe
 def _gettablerowindex(self, window, table, target):
   numrows = ldtp.getrowcount(window, table)
   numcols = len(ldtp.getobjectproperty(window, table, 'children').split())
   for i in range(0,numrows):
     for j in range(0,numcols):
       try:
         value = ldtp.getcellvalue(window, table, i, j)
         if self._matches(target,value):
           ldtp.selectrowindex(window, table, i)
           return i
       except:
         continue
   raise Exception("Item not found in table!")
示例#5
0
    def get_row_count(self, window_name, object_name):
        """
        Description: Get count of rows in table object.

        :param window_name: Window name to look for, either full name,
        LDTP's name convention, or a Unix glob.

        :param object_name: Object name to look for, either full name,
        LDTP's name convention, or a Unix glob. Or menu heirarchy

        :return: Number of rows.
        """
        try:
            self._info("get row count of table [%s, %s]" %
                       (window_name, object_name))
            return ldtp.getrowcount(window_name, object_name)
        except LdtpExecutionError:
            raise LdtpExecutionError("get row count of table failed")
示例#6
0
    def to_script( self, val ,flag ,key=None):
	print flag
	if(define.NORMAL==flag):
		val = val.replace( "<parent>", "\"%s\""%self.parent )
        	val = val.replace( "<self>", "\"%s\""%self.self )
	if(define.PTAB==flag):  #ptab flag=1
		val=val.replace("<parent>","\"%s\""%self.parent)
		val=val.replace("<tab_list_name>","\"ptl0\"")
		tmp=ldtp.getobjectproperty(self.parent,self.self,'child_index')
		val=val.replace("<self_index>","%d"%tmp)
	if(define.LST==flag):  #lst flag=2
		val=val.replace("<parent>","\"%s\""%self.parent)
		val=val.replace("<component_name>","\"%s\""%key)
		tmp=ldtp.getobjectproperty(self.parent,self.self,'child_index')
		val=val.replace("<self_index>","%d"%tmp)
	if(define.MNU_ITEM==flag):  #mnu_item flag=3
		val=val.replace("<parent>","\"%s\""%self.parent)
		val=val.replace("<mnu;mnuitem>","\"%s\""%key)
	if(define.TBL==flag):  #tbl flag=4
		val=val.replace("<parent>","\"%s\""%self.parent)
		val=val.replace("<self>","\"%s\""%self.self)
		tmp=ldtp.getrowcount(self.parent,self.self)
		val=val.replace("<child_index>","0~%d"%(tmp-1))
        return val
示例#7
0
 def get_table_row_count(self, window, table_name):
     return ldtp.getrowcount(RHSMGuiLocator().get_locator(window), RHSMGuiLocator().get_locator(table_name))
示例#8
0
文件: common.py 项目: UIKit0/glom
def check_small_business_integrity():
	if(ldtp.getrowcount(main_window, 'tblTableContent') != 9):
		raise ldtp.LdtpExecutionError("Newly created database does not contain all 8 rows"); # Note there is one placeholder row

	ldtp.selecttab(main_window, 'ptlListOrDetailsView', 'Details')