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

The LegacyWindow class doesn't work anymore #138

Open
aik099 opened this issue Mar 20, 2024 · 1 comment · May be fixed by #139
Open

The LegacyWindow class doesn't work anymore #138

aik099 opened this issue Mar 20, 2024 · 1 comment · May be fixed by #139

Comments

@aik099
Copy link
Contributor

aik099 commented Mar 20, 2024

The LegacyWindow class in the master branch no longer includes a window handle (or current for the current window) in the made cURL requests to the Selenium server. This results in the /session/{sessionId}/window/size URL instead of the /session/{sessionId}/window/{windowHandle}/size URL.

Constructor declaration change fixes all window commands, except for the LegacyWindow::getHandle method:

if ($windowHandle === null) {
    $windowHandle = 'current';
}

parent::__construct($url . '/' . $windowHandle);

// The "current" meta-handle isn't accepted by any other command.
if ($windowHandle !== 'current') {
    $this->windowHandle = $windowHandle;
}

With the above fix the LegacyWindow::getHandle now queries the /session/{sessionId}/window/{windowHandle}_handle URL instead of the /session/{sessionId}/window_handle.

Since the \WebDriver\AbstractWebDriver::curl method can't subtract URL parts, then the only way to fix this was actually to implement all the window manipulation methods instead of relying on the AbstractWebDriver::__call method.

P.S.
Apparently, the JsonWireProtocol supports resizing of the non-active windows, which W3C does not allow.

@aik099 aik099 linked a pull request Mar 21, 2024 that will close this issue
@aik099
Copy link
Contributor Author

aik099 commented Mar 21, 2024

The #139 solves all of the described problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant