Commit 7e3a7450 authored by Arnaud Fontaine's avatar Arnaud Fontaine

Fix XPATH expressions for getListboxPosition()


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@44874 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 96325ceb
......@@ -348,17 +348,19 @@ class Browser(ExtendedTestBrowser):
# Require either column_number or line_number to be given
onlyOne([column_number, line_number], '"column_number" and "line_number"')
cell_type = line_number <= 2 and 'th' or 'td'
# Get all cells in the column (if column_number is given and
# including header columns) or line (if line_number is given)
if column_number:
column_or_line_xpath_str = '//tr//%s[%d]' % (cell_type, column_number)
xpath_str_fmt = self._listbox_table_xpath_str + '//tr//%%s[%d]' % \
column_number
column_or_line_xpath_str = "%s | %s" % (xpath_str_fmt % 'th',
xpath_str_fmt % 'td')
else:
column_or_line_xpath_str = '//tr[%d]//%s' % (line_number, cell_type)
column_or_line_xpath_str = self._listbox_table_xpath_str + '//tr[%d]//%s' %\
(line_number, line_number <= 2 and 'th' or 'td')
# Get all cells in the column (if column_number is given) or line
# (if line_number is given)
cell_list = self.etree.xpath(self._listbox_table_xpath_str + \
column_or_line_xpath_str)
cell_list = self.etree.xpath(column_or_line_xpath_str)
# Iterate over the cells list until one the children content
# matches the expected text
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment