Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Inconsistent driver behavior when switching to a frame by index #2162

Closed
lukeis opened this issue Mar 3, 2016 · 7 comments
Closed

Inconsistent driver behavior when switching to a frame by index #2162

lukeis opened this issue Mar 3, 2016 · 7 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 3, 2016

Originally reported on Google Code with ID 2162

When switching to a frame by index, the different web driver implementations may select
different frames. This happens only if additional (i)frames were created by JavaScript
code. For example, if there is a page with an iframe and some JS inserts a second iframe
*before* the first frame, some of the drivers get confused.

There are two issues. First, of course all drivers should select the same (i)frame
in this situation. 

Second, the web driver documentation should be more precise:

"Select a frame by its (zero-based) index. That is, if a page has three frames, the
first frame would be at index "0", the second at index "1" and the third at index "2"."


It is not clear what exactly is meant with "first" frame, etc. Is it the first frame
in the DOM tree or is it the first frame created? From the user's point of view, "first
in DOM tree" is probably the better choice.

Selenium version: 2.2.0
OS: Windows 7

Reported by jw_google@gmx.de on 2011-08-01 11:21:25

@lukeis lukeis closed this as completed Mar 3, 2016
@lukeis lukeis changed the title placeholder empty issue Inconsistent driver behavior when switching to a frame by index Mar 3, 2016
@lukeis lukeis self-assigned this Mar 3, 2016
@lukeis lukeis reopened this Mar 3, 2016
@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Added test case.

Reported by jw_google@gmx.de on 2011-08-01 11:23:30


- _Attachment: [Issue2162.java](https://storage.googleapis.com/google-code-attachments/selenium/issue-2162/comment-1/Issue2162.java)_ - _Attachment: [Issue2162.html](https://storage.googleapis.com/google-code-attachments/selenium/issue-2162/comment-1/Issue2162.html)_

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by barancev on 2011-10-13 07:11:10

  • Labels added: Component-WebDriver

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by dawagner on 2012-04-11 22:30:16

  • Labels added: GettingInvolved

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

It is specified in the standard [1]:
---
If the "id" is a number the current context is set to the equivalent of the JS expression
"window.frames[n]"
---
So it's up to the browser vendor to define frame order.

Javadoc is updated.

If you feel it can be non-deterministic please use other ways to specify a target frame.

[1] https://dvcs.w3.org/hg/webdriver/raw-file/tip/webdriver-spec.html#switching-frames

Reported by barancev on 2013-08-23 19:54:59

  • Status changed: WontFix

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Sorry, the issue is valid. Reproduced, FirefoxDriver orders frames wrong.

Reported by barancev on 2014-02-12 22:17:25

  • Status changed: Accepted

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Specification changed, see [1] and [2]

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=972902
[2] https://www.w3.org/Bugs/Public/show_bug.cgi?id=24662

Reported by barancev on 2014-05-15 20:45:41

  • Status changed: WontFix

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by luke.semerau on 2015-09-17 18:13:23

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this as completed Mar 3, 2016
@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant