-
Notifications
You must be signed in to change notification settings - Fork 14
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
Support for frames/iframes #116
Comments
|
Just thinking about a possible implementation should we either enhance the |
The default element locator can handle that. Nobody really restricts one element locator to operate only on one annotation. |
In that case we need to access either the session or the driver itself to switch to Frame. Either we put it as part of the |
No need. The search context is a real element (if I'm not mistaken), not a proxy. When we switch a frame and find an element there, then the returned element reference (inside Mink) contains (that needs to be tested) the frame where element was found. So even if you switch the frame, the element retrieved earlier should still act as |
I tested it, the element is found. But accessing it and changing the value will force selenium to search for the element again to alter the value resulting in a not found when switching back initially. This means that we either need to hook on every driver access (location of the element) and switch the target frame or the implementation itself needs to be done in Mink and its drivers. |
You're correct. Mink only retains XPATH of element found via the Driver (e.g. Selenium, Sahi). Then this xpath is used to perform all further actions (even finding sub-elements). To make this happen we need to:
Doesn't sound like an easy task. Let's postpone this for now. |
Interesting idea posted here: yandex-qatools/htmlelements#56 (comment) So we switch to frame once > do the stuff > switch back. Since we do it outside of the elements no need to switch back/forth on each element query. |
Idea is to allow specifying frame/iframe name where element is located so that when somebody wants to access it an automatic switch to that frame happens and then switch back to original window/frame happens.
Possible implementations:
@frame('test-name')
or@frame('name' => 'test-name')
annotationframe
parameter for@find-by
annotation (e.g.@find-by('id' => 'test-id', 'frame' => 'test-name')
)When used then:
switchToFrame
method of MinkIf was used on element container (sub-class of
AbstractElementContainer
, that was calledHtmlElement
before), then there is no need to specify frame/iframe on each element in this container because they'll be searched within container located in another frame/iframe anyway.Egde cages:
The text was updated successfully, but these errors were encountered: