Comments (7)
@uuf6429 , I'm not saying it's a bug. I'm saying that method signature change has prevented certain (might not be documented) Mink usage scenarios from working.
Since method DocBlock always was string|null $name
, then nobody likely thought that specifying a frame index was actually an option. However, due to WebDriver ->frame(...)
being used internally, it worked perfectly.
P.S.
- Frame switching by name works with Selenium 3 + https://github.com/minkphp/webdriver-classic-driver .
- I really want to know why it doesn't with https://github.com/minkphp/MinkSelenium2Driver (the bug in the https://github.com/instaclick/php-webdriver maybe).
from mink.
(clean) Or revert relevant switchToIFrame method signature changes, because $name can't be declared as both integer and string (in supported PHP versions).
Implemented in these PRs:
- #867 (merge this first)
- minkphp/driver-testsuite#87 (rerun tests to see they now pass and then merge)
- minkphp/MinkSelenium2Driver#378
- minkphp/webdriver-classic-driver#11
I've also updated relevant DocBlocks to indicate, that frame index can also be specified.
Probably the $name
parameter of the switchToIFrame
methods should be renamed into the $nameOrIndex
to make IDE code assist a bit more helpful.
from mink.
Before calling this a bug, let's be clear - it was never defined that we can switch an iframe by index, as can be seen by your update of that comment:
https://github.com/minkphp/Mink/pull/867/files#diff-d76d9e3222ed852fe6951aa849d5e7c111042b6a5209a9fe6b53c0c7c7530735R187
I'm fine with supporting this though, just saying that any old usages with integers were misuses.
from mink.
Update: with the help of the @uuf6429 , I was able to get frame switching by name working on Selenium 3 (see minkphp/MinkSelenium2Driver#382).
from mink.
@stof , I only need a review from you. The merging and build rerunning I can do myself to save your time.
Also please look at the minkphp/MinkSelenium2Driver#382.
from mink.
I don't think using an integer index was ever meant to be supported in the Mink API. It worked in Selenium2Driver in the past only due to the lack of native parameter types that allowed to ignore the intended method signature.
If we were adding support for integer indexes in the Mink API, we would have to specify the meaning of those indexes. And if we say "this is the index in WebDriver Classic", this would not impossible to implement in any driver not based on the WebDriver protocol.
As you managed to fix the issue in the Selenium2Driver to actually support names, I suggest closing this issue.
from mink.
Agreed.
Here are the actions I've performed based on your response:
Closed
Repurposed
- minkphp/driver-testsuite#87 (tests frame switching by an ID)
from mink.
Related Issues (20)
- Feature: set basic auth after session start and reset HOT 3
- PHP 8.1 compatible release HOT 10
- Element attribute not exists HOT 1
- symfony/css-selector 6.0 compatibility with behat/mink HOT 1
- Symfony 6 compatible release
- Mink's use of stripos leads to some empty string behaviors in PHP 8 HOT 3
- Element not interactable even though it is in view (scrolled to) and visible HOT 1
- Add case-sensitive comparison option to function WebAssert::elementContains HOT 5
- Empty read; connection dead HOT 1
- Support Browserless HOT 2
- GET Request HOT 2
- Allow custom processing of WebAssert::assert through callback HOT 9
- Is this project active? HOT 2
- Strictly typed methods HOT 3
- Class "Behat\Mink\Mink" not found HOT 5
- Release with Symfony 7
- responseHeaderEquals() can no longer be used to check for existence HOT 3
- submit form and get resulting page?! HOT 1
- Switching windows by name or handle? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mink.