-
Notifications
You must be signed in to change notification settings - Fork 25
Make switch to frame possible #9
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
Conversation
try { | ||
$els = $this->_findElements("iframe[name='$locator']"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that it would be better to make switchToIFrame
behave as before by changing locator to match frames and iframes:
$els = $this->_findElements("iframe[name='$locator'] | frame[name='$locator']");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not say so, as the name of method is missleading, it have IFrame in it, so it should work with iframes, even if it was possible to be used with frames before. Or, the name should be changed to switchToFrame then, and used for iframes as well. But thats just my opinion, would be better to vote for it probably :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the name is backwards compatibility break,
making switchToIframe work with frames as before is backwards compatibility fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but:
- Making it working as before will make the method misused again. The fix should be introduced, but with the deprecation of this functionality maybe?
- Renaming could be done with the deprecation of the old method as well, it's not critical to just rename it.
Sure, it is your decision how to handle this question, but me personally would prefer the chaos to be more organized with the time, but not just fixed to be working somehow :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DavertMik thinks that switchToIframe working with frames is a feature, not a bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Naktibalda But it leads to misunderstandings while it does more than its described, and then people can change the code without even thinking about those "features" and one day those are stopping to work. So either you need two methods or better documentation/implementation on the old one. Feel free to do as you think is better.
@Naktibalda Feel free to reopen if someone is interested in fixing this, I have just introduced clearly named methods for our project for now. |
I apologize for forgetting your pull request. Nobody else seem to care about it and nobody has reported that original behaviour is broken, so keeping backwards compatibility is not that important. I will merge your change. |
Released as 1.1.0 |
As locator near the name was changed to iframe recently, and we have used that switchToIframe for switching between our frames as well, i would like to ask introducing the switchToFrame method as well alongside the old switchToIframe one, if possible.
p.s. i was not able to run the tests on this repository, would be super great to have more information how to do it in the readme.
Thanks for your work guys!