Skip to content

Commit

Permalink
Merge pull request #1895 from emanlove/add-warning-under-pageshouldco…
Browse files Browse the repository at this point in the history
…ntain-1894

Added warning to `Page Should Contain` keyword
  • Loading branch information
emanlove committed Apr 30, 2024
2 parents d76883a + 8d9940c commit 473c5d4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/SeleniumLibrary/keywords/element.py
Expand Up @@ -132,6 +132,12 @@ def page_should_contain(self, text: str, loglevel: str = "TRACE"):
argument. Valid log levels are ``TRACE`` (default), ``DEBUG``,
``INFO``, ``WARN``, and ``NONE``. If the log level is ``NONE``
or below the current active log level the source will not be logged.
!! WARNING !! If you have an iframe selected, `Page Should Contain`
will reset the frame reference back to the main frame. This is due
to the fact that is searches for the ``text`` in all frames. To locate
an element in an iframe after calling `Page Should Contian` one needs
to (re)select the frame.
"""
if not self._page_contains(text):
self.ctx.log_source(loglevel)
Expand Down

0 comments on commit 473c5d4

Please sign in to comment.