From 8d9940cf92803c8f71436c59e4fc80307554f2d7 Mon Sep 17 00:00:00 2001 From: Ed Manlove Date: Sun, 28 Apr 2024 16:19:06 -0400 Subject: [PATCH] Added warning to `Page Should Contain` keyword Added warning about the deselection of the frame reference. Fixes #1894 --- src/SeleniumLibrary/keywords/element.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/SeleniumLibrary/keywords/element.py b/src/SeleniumLibrary/keywords/element.py index d277791f5..2eaa3835f 100644 --- a/src/SeleniumLibrary/keywords/element.py +++ b/src/SeleniumLibrary/keywords/element.py @@ -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)