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

Screenplay option to browser.switchTo().frame(element(by.tagName('iframe'))); #227

Closed
tfarrar opened this issue May 25, 2018 · 2 comments
Closed
Labels
enhancement A good idea that should be implemented @serenity-js/protractor Adapter and interactions for Angular Protractor

Comments

@tfarrar
Copy link

tfarrar commented May 25, 2018

I need the ability to switch to a frame similar to way it is done in protractor below. Is there a way I can access the lower level browser in serenity screenplay to switch to frame?

it('should switch to iframe', function () {
browser.switchTo().frame(element(by.tagName('iframe')));
});

// Screenplay option I found.
Switch.toWindowNumber(1),
BrowseTheWeb.as(actor).switchToParentWindow(0),
BrowseTheWeb.as(actor).switchToWindow(),

@AbhineetSharmax
Copy link

AbhineetSharmax commented Jul 25, 2018

Hi Tfarrar,

For a workaround you may manage, serenity iframe switches using below line of code,

browser.driver.switchTo().frame(0);

@jan-molak jan-molak added enhancement A good idea that should be implemented @serenity-js/protractor Adapter and interactions for Angular Protractor labels Jul 26, 2018
@marktigno
Copy link

marktigno commented Aug 1, 2018

Try checking my solution on that here #233

@jan-molak jan-molak added this to To do in Serenity/JS Board Mar 14, 2020
@jan-molak jan-molak moved this from To do to In progress in Serenity/JS Board Oct 4, 2020
Serenity/JS Board automation moved this from In progress to Done Oct 5, 2020
jan-molak added a commit that referenced this issue Mar 2, 2022
Interaction to `Switch.to(switchable)` works for both `Page` and `PageElement` now. For
`PageElement`, if the element represents a `frame` or `iframe`, `Switch.to(element)` switches the
top-level browsing context to that frame. When a `PageElement` represents any other HTML element,
invoking `Switch.to(element)` sets browser focus on that element.

re #82 #227 #233 #365
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A good idea that should be implemented @serenity-js/protractor Adapter and interactions for Angular Protractor
Projects
Development

No branches or pull requests

4 participants