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

Add ability to run as Grid node #145

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sbabcoc
Copy link

@sbabcoc sbabcoc commented Feb 7, 2024

No description provided.

@rbri
Copy link
Collaborator

rbri commented Feb 11, 2024

Hi @sbabcoc,

many thanks for the contribution. So far i have not done anything with the grid version of selenium but i think this is a rally great addition to the current impl.

I'm a bit busy during the next days but will have a closer look at this at the end of the next week.

But i have a first question - do you have an idea how to test this as part of our CI?

@sbabcoc
Copy link
Author

sbabcoc commented Feb 11, 2024

Hi, @rbri,
Many thanks for your tireless efforts to provide this useful headless browser. It's very complex, undoubtedly requiring a lot of effort to maintain and enhance.

The test for this would be to ensure that HtmlUnitDriver can be instantiated as a RemoteWebDriver instance. The behavior of a working implementation should be indistinguishable from a direct instance of HtmlUnitDriver. This was possible in Selenium 3, because the Grid Node implementation provided special-case handling for HtnlUnitDriver through an in-memory wrapper. This special-case support was removed in Selenium 4.

For now, it's probably best to ignore this PR. It's nowhere near ready to be merged. I've been poking at this for a while and keep falling into the gaping holes in my knowledge about how Selenium driver executable are assembled. What I'm imagining is needed is a Java executable that wraps the HtmlUnitDriver class in a LocalNode container that routes requests to the correct WebDriver functions and sends back the responses.

I sent you an email the other day requesting suggestions for what should be included in the HtmlUnitOptions class that will be needed to complete this wrapper. It seems that the WebClientOptions class encapsulates everything, so perhaps we can create an extension of AbstractDriverOptions that builds one of these.

@sbabcoc sbabcoc force-pushed the pr/add-driver-info branch 7 times, most recently from 91cf24b to 8abb4eb Compare March 6, 2024 08:00
@sbabcoc sbabcoc force-pushed the pr/add-driver-info branch 11 times, most recently from d7ec645 to 89f02c9 Compare March 11, 2024 02:09
@sbabcoc
Copy link
Author

sbabcoc commented Mar 11, 2024

@rbri I have this PR to a point where all of the HtmlUnit options can be set via a custom Capabilities class (HtmlUnitDriverOptions). This is essentially a Capabilities wrapper for the WebClientOptions class, with an added BrowserVersion property. This could potentially open up scenarios that weren't previously accessible. I still need to create a launcher to enable standalone execution.

@sbabcoc
Copy link
Author

sbabcoc commented Mar 11, 2024

To make the capabilities completely portable, I think I'll need to define a serialization mechanism for the BrowserVersion class and the types it uses.

@sbabcoc sbabcoc force-pushed the pr/add-driver-info branch 7 times, most recently from 3fae804 to 9339dcc Compare March 16, 2024 06:44
@sbabcoc sbabcoc force-pushed the pr/add-driver-info branch 12 times, most recently from 0ec6494 to 8f583f0 Compare May 19, 2024 20:54
@sbabcoc sbabcoc force-pushed the pr/add-driver-info branch 16 times, most recently from 9032c81 to 40ab727 Compare May 24, 2024 16:12
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 this pull request may close these issues.

None yet

2 participants