Skip to content

Commit 473c5d4

Browse files
authored
Merge pull request #1895 from emanlove/add-warning-under-pageshouldcontain-1894
Added warning to `Page Should Contain` keyword
2 parents d76883a + 8d9940c commit 473c5d4

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)