Skip to content

Fix and cleanup logic related to frames #959

Open

Description

@pekkaklarck

There are currently several problems with handling frames that should be resolved. Some of these problems are already covered by existing issues, but this new issue list all these highly related problems in one place. The whole frame handling logic should be rewritten and all these problems resolved at the same time.

  1. Page Should (Not) Contain searches text from frames, but only searches from one level and not from sub frames (Inconsistency in page/frame related keyword #98)
  2. Other keywords don't look inside frames at all. This includes Page Should (Not) Contain Element and Current Frame Should (Not) Contain. (Inconsistency in page/frame related keyword #98)
  3. Page Should (Not) Contain internally selects the main frame, disabling earlier Select Frame calls.(Select Frame Keyword behaviour #201)
  4. We should see could we deprecate all Current Frame ... keywords. It would be better that after selecting a frame, all subsequent keywords would operate in the frame. This may actually already be the case, except with Page Should (Not) Contain which looks from the root (see 3. above).
  5. If all keywords operate on the selected frame, Page Should is pretty misleading wording. Should we consider renaming these keywords like Page Should Contain -> Text Should Be Present, Page Should Contain Element -> Element Should Be Present?

Activity

  1. added this to the v3.1.0 milestone on Oct 18, 2017
  2. mcleanmds commented on Feb 2, 2018

    @mcleanmds

    Additionally to the problems already listed, there is a similar problem with the Frame Should Contain Keyword, the driver is switched back to the default context, which is undesirable when working on sub frames. (expected to end up at the window/frame that we started from, not the main window).

  3. modified the milestones: v3.2.0, v3.3.0 on Mar 6, 2018
  4. modified the milestones: v3.2.0, v3.3.0 on Sep 13, 2018
  5. removed this from the v3.3.0 milestone on Dec 12, 2018
  6. tmaleckiplacester commented on Aug 30, 2019

    @tmaleckiplacester

    Any update on this one?

  7. aaltat commented on Aug 30, 2019

    @aaltat
    Contributor

    There is not progress for this issue because no-one has seen it enough important to invest time.

  8. MininAS commented on May 4, 2020

    @MininAS

    @pekkaklarck Do we have some progress in this issue :)

  9. aaltat commented on May 4, 2020

    @aaltat
    Contributor

    Nothing has happened since my last comment.

  10. jck1307 commented on Nov 3, 2020

    @jck1307

    Hi,
    My problem is related to frames management with RFW but I don't know if it's the right place to discuss about it.

    I'm using RFW 3.2.2 with Python 3.9 on Windows with FF or Chrome.

    I'm working on a app with lots of frames which contains iframes, some are dynamically created...

    • Page
      • Frame1
        • IFrame1
        • IFrame2 (not created yet)
      • Frame2
      • Frame3

    Select Frame Frame1 is OK
    Select Frame IFrame1 is OK (Displays a form)
    Input Text Name Hello is OK
    Click Button Save (button in the IFrame1) is OK (by clicking this button, the app dynamically creates a new iframe IFrame2)
    Unselect Frame
    Select Frame IFrame2

    IFrame2 can't be selected. If I execute javascript to get the reference, I can get it but I then get the StaleReferenceException if I try to select it through Select Frame

    Any ideas?

  11. jck1307 commented on Nov 3, 2020

    @jck1307

    Ok, I found the solution. As I read somewhere in another issue, Unselect Frame returns you to the top parent, so the solution was to look for the elements from the beginning.

    So after the Unselect Frame, I now do:

    Select Frame Frame1
    Select Frame IFrame2

    and everything works like a charm.

    But the issue about the top parent is annoying because really not intuitive.

    Sorry to have bothered you for so little things but I was going crazy...

    Thanks for the work, RFW is really interesting.

    JC

  12. aaltat commented on Nov 3, 2020

    @aaltat
    Contributor

    Yes, we do not keep track of the frames and Selenium API only allows to select top most page.

    If that is not documented, then it should be fixed.

  13. jck1307 commented on Nov 3, 2020

    @jck1307

    Indeed, in the docs (https://robotframework.org/Selenium2Library/Selenium2Library.html#Unselect%20Frame) it is written:

    • Unselect Frame : Sets the main frame as the current frame. In practice cancels the previous Select Frame call.

    It should be better to say it cancels all the previous Select Frame calls and sets you to the top, not the direct parent.

    All is a little word, but it matters :-D

    JC

  14. aaltat commented on Nov 3, 2020

    @aaltat
    Contributor

    Yes, that could be enhanced. Would you like make a PR to fix it?

  15. aaltat commented on Nov 3, 2020

    @aaltat
    Contributor

    Please remember that Selenium2Library is not maintained and correct project is https://github.com/robotframework/SeleniumLibrary#keyword-documentation (Although the text is same in both)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions