Open aik099 opened 6 months ago
Please keep any discussion about the changing the Mink API in the main Mink repo rather than in drivers please.
Please keep any discussion about the changing the Mink API in the main Mink repo rather than in drivers please.
Understood. Moved the issue to the main repo.
Technical limitations
name
or byhandle
(see https://www.selenium.dev/documentation/legacy/json_wire_protocol/#sessionsessionidwindow)handle
only (see https://www.w3.org/TR/webdriver2/#switch-to-window)Switching windows by a handle
Switching windows by a name
Current implementation
getWindowName
method returns a handlegetWindowNames
method returns a handles arrayswitchToWindow
on Selenium 2 can switch windows by name/handle (see Technical limitations above)switchToWindow
on Selenium 3 can switch windows by a handle only (see Technical limitations above)Proposed implementation
See https://github.com/minkphp/MinkSelenium2Driver/pull/384 .
getWindowName
method returns a window name (if non-empty) or a handlegetWindowNames
method returns a window name (if non-empty) or a handle arrayswitchToWindow
can switch windows by a name/handle, but needs to iterate/focus over each window to determine the handle by its nameThe downside of the proposed implementation
getWindowName
orgetWindowNames
would produceNoSuchWindow
exception, when given to theswitchToWindow
methodComments from contributors
In the https://github.com/minkphp/MinkSelenium2Driver/pull/384/files#r1501886088 @uuf6429 proposed to replace window name support with window handle support Mink-wise. Considering, that Selenium-based drivers are the only ones that support window operations now.
In the https://github.com/minkphp/MinkSelenium2Driver/pull/384/files#r1501840465 @mvorisek explained window handle workflow like this:
I personally like the proposed implementation, because: