Skip to content

Commit db90972

Browse files
committed
Merge pull request #431 from zephraph/rf-2.9-hotfix
Hotfix for RF 2.9
2 parents 7e5dbb2 + 1ae25da commit db90972

File tree

3 files changed

+23
-19
lines changed

3 files changed

+23
-19
lines changed

CHANGES.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
Release Notes
22
=============
33

4-
1.7
4+
1.7.1 (hotfix)
5+
----------------
6+
- Remove references to GLOBAL_VARIABLES for RF 2.9 compatibility
7+
8+
1.7
59
----------------
610
- Added keyword 'List Windows' to return a list of all window handles.
711
[divfor]

src/Selenium2Library/keywords/_logging.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22
import sys
3-
from robot.variables import GLOBAL_VARIABLES
3+
from robot.libraries.BuiltIn import BuiltIn
44
from robot.api import logger
55
from keywordgroup import KeywordGroup
66

@@ -12,10 +12,11 @@ def _debug(self, message):
1212
logger.debug(message)
1313

1414
def _get_log_dir(self):
15-
logfile = GLOBAL_VARIABLES['${LOG FILE}']
15+
variables = BuiltIn().get_variables()
16+
logfile = variables['${LOG FILE}']
1617
if logfile != 'NONE':
1718
return os.path.dirname(logfile)
18-
return GLOBAL_VARIABLES['${OUTPUTDIR}']
19+
return variables['${OUTPUTDIR}']
1920

2021
def _html(self, message):
2122
logger.info(message, True, False)
@@ -38,4 +39,4 @@ def _log_list(self, items, what='item'):
3839
return items
3940

4041
def _warn(self, message):
41-
logger.warn(message)
42+
logger.warn(message)

src/Selenium2Library/keywords/_tableelement.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import os
22
import sys
3-
from robot.variables import GLOBAL_VARIABLES
43
from robot.api import logger
54
from Selenium2Library.locators import TableElementFinder
65
from 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

Comments
 (0)