Skip to content

Commit 8d9940c

Browse files
committed
Added warning to Page Should Contain keyword
Added warning about the deselection of the frame reference. Fixes #1894
1 parent 15b57e9 commit 8d9940c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/SeleniumLibrary/keywords/element.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@ def page_should_contain(self, text: str, loglevel: str = "TRACE"):
132132
argument. Valid log levels are ``TRACE`` (default), ``DEBUG``,
133133
``INFO``, ``WARN``, and ``NONE``. If the log level is ``NONE``
134134
or below the current active log level the source will not be logged.
135+
136+
!! WARNING !! If you have an iframe selected, `Page Should Contain`
137+
will reset the frame reference back to the main frame. This is due
138+
to the fact that is searches for the ``text`` in all frames. To locate
139+
an element in an iframe after calling `Page Should Contian` one needs
140+
to (re)select the frame.
135141
"""
136142
if not self._page_contains(text):
137143
self.ctx.log_source(loglevel)

0 commit comments

Comments
 (0)