def dt_action(row=1, action=None, column=1, tableID='datatable'):
 config = current.test_config
 browser = config.browser
 if action:
  button = (".//*[@id='%s']/tbody/tr[%s]/td[%s]/a[contains(text(),'%s')]" % (tableID, row, column, action))
 else:
  button = (".//*[@id='%s']/tbody/tr[%s]/td[%s]/a" % (tableID, row, column))
 giveup = 0.0
 sleeptime = 0.2
 while (giveup < 10.0):
  try:
   element = browser.find_element_by_xpath(button)
   url = element.get_attribute('href')
   if url:
    browser.get(url)
    return True
  except Exception as inst:
   print ('%s with %s' % (type(inst), button))
  time.sleep(sleeptime)
  giveup += sleeptime
 return False

def dt_action ( row = 1 , action = None , column = 1 , tableID = 'datatable' ) : config = current . test_config browser = config . browser if action : button = ( ".//*[@id='%s']/tbody/tr[%s]/td[%s]/a[contains(text(),'%s')]" % ( tableID , row , column , action ) ) else : button = ( ".//*[@id='%s']/tbody/tr[%s]/td[%s]/a" % ( tableID , row , column ) ) giveup = 0.0 sleeptime = 0.2 while ( giveup < 10.0 ) : try : element = browser . find_element_by_xpath ( button ) url = element . get_attribute ( 'href' ) if url : browser . get ( url ) return True except Exception as inst : print ( '%s with %s' % ( type ( inst ) , button ) ) time . sleep ( sleeptime ) giveup += sleeptime return False
click the action button in the datatable .