11import os
22import sys
3- from robot .variables import GLOBAL_VARIABLES
43from robot .api import logger
54from Selenium2Library .locators import TableElementFinder
65from keywordgroup import KeywordGroup
@@ -17,10 +16,10 @@ def get_table_cell(self, table_locator, row, column, loglevel='INFO'):
1716
1817 Row and column number start from 1. Header and footer rows are
1918 included in the count. A negative row or column number can be used
20- to get rows counting from the end (end: -1). Cell content from header
21- or footer rows can be obtained with this keyword. To understand how
19+ to get rows counting from the end (end: -1). Cell content from header
20+ or footer rows can be obtained with this keyword. To understand how
2221 tables are identified, please take a look at the `introduction`.
23-
22+
2423 See `Page Should Contain` for explanation about `loglevel` argument.
2524 """
2625 row = int (row )
@@ -32,13 +31,13 @@ def get_table_cell(self, table_locator, row, column, loglevel='INFO'):
3231 table = self ._table_element_finder .find (self ._current_browser (), table_locator )
3332 if table is not None :
3433 rows = table .find_elements_by_xpath ("./thead/tr" )
35- if row_index >= len (rows ) or row_index < 0 :
34+ if row_index >= len (rows ) or row_index < 0 :
3635 rows .extend (table .find_elements_by_xpath ("./tbody/tr" ))
37- if row_index >= len (rows ) or row_index < 0 :
36+ if row_index >= len (rows ) or row_index < 0 :
3837 rows .extend (table .find_elements_by_xpath ("./tfoot/tr" ))
3938 if row_index < len (rows ):
4039 columns = rows [row_index ].find_elements_by_tag_name ('th' )
41- if column_index >= len (columns ) or column_index < 0 :
40+ if column_index >= len (columns ) or column_index < 0 :
4241 columns .extend (rows [row_index ].find_elements_by_tag_name ('td' ))
4342 if column_index < len (columns ):
4443 return columns [column_index ].text
@@ -58,7 +57,7 @@ def table_cell_should_contain(self, table_locator, row, column, expected, loglev
5857
5958 To understand how tables are identified, please take a look at
6059 the `introduction`.
61-
60+
6261 See `Page Should Contain` for explanation about `loglevel` argument.
6362 """
6463 message = ("Cell in table '%s' in row #%s and column #%s "
@@ -78,7 +77,7 @@ def table_cell_should_contain(self, table_locator, row, column, expected, loglev
7877 def table_column_should_contain (self , table_locator , col , expected , loglevel = 'INFO' ):
7978 """Verifies that a specific column contains `expected`.
8079
81- The first leftmost column is column number 1. A negative column
80+ The first leftmost column is column number 1. A negative column
8281 number can be used to get column counting from the end of the row (end: -1).
8382 If the table contains cells that span multiple columns, those merged cells
8483 count as a single column. For example both tests below work,
@@ -136,10 +135,10 @@ def table_header_should_contain(self, table_locator, expected, loglevel='INFO'):
136135 def table_row_should_contain (self , table_locator , row , expected , loglevel = 'INFO' ):
137136 """Verifies that a specific table row contains `expected`.
138137
139- The uppermost row is row number 1. A negative column
140- number can be used to get column counting from the end of the row
141- (end: -1). For tables that are structured with thead, tbody and tfoot,
142- only the tbody section is searched. Please use `Table Header Should Contain`
138+ The uppermost row is row number 1. A negative column
139+ number can be used to get column counting from the end of the row
140+ (end: -1). For tables that are structured with thead, tbody and tfoot,
141+ only the tbody section is searched. Please use `Table Header Should Contain`
143142 or `Table Footer Should Contain` for tests against the header or
144143 footer content.
145144
@@ -169,4 +168,4 @@ def table_should_contain(self, table_locator, expected, loglevel='INFO'):
169168 if element is None :
170169 self .log_source (loglevel )
171170 raise AssertionError ("Table identified by '%s' should have contained text '%s'." \
172- % (table_locator , expected ))
171+ % (table_locator , expected ))
0 commit comments