Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added warning to Page Should Contain keyword #1895

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/SeleniumLibrary/keywords/element.py
Original file line number Diff line number Diff line change
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