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

[🚀 Feature]: Java: let me configure SeleniumManager on creating Driver Object #12970

Closed
RaHehl opened this issue Oct 19, 2023 · 8 comments
Closed

Comments

@RaHehl
Copy link

RaHehl commented Oct 19, 2023

Feature and motivation

Hello,

According to #12793 #11687 #12914 I want to configure SeleniumManager via the driver constructors.

As far as I currently know, I need to create a configuration file or set an environment variable to configure Selenium Manager https://www.selenium.dev/documentation/selenium_manager/

I would like to configure it via code, like in my "Usage example"

I wanted to create a PR for this, but I haven't managed to get my Intelij running with Bazel on my Windows developer client.

Usage example

ChromeOptions chromeOptions = new ChromeOptions();
List<String> managerArguments = new ArrayList<>();
managerArguments.add("--driver-mirror-url");
managerArguments.add("https://MyDriverMirror");
managerArguments.add("--browser-mirror-url");
managerArguments.add("https://myBrowserMirror");
WebDriver driver = new ChromeDriver(chromeOptions, managerArguments);
@github-actions
Copy link

@RaHehl, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@titusfortner
Copy link
Member

I do not want to add new constructors.

We have options for making adjustments in the code, but I think the right way for these system level issues is to make use of the configuration file.

@RaHehl
Copy link
Author

RaHehl commented Oct 19, 2023

ok, what about a config singleton as an alternative? In my usecase, file is also ugly,

As I understand it, the Selenium Manager was actually intended not to have to deal with client-specific configs again

@titusfortner
Copy link
Member

We want to make it so you don't have to rely on additional libraries, and we want to make it easy to get the right browser/driver combination. The more edge cases we bake in the more complicated the code, the harder it is to maintain it.

There is something we might do code-wise, but only if it makes it easier to maintain, not harder, and we're still discussing it.

The answer right now is either a config file or environment variables.

@RaHehl
Copy link
Author

RaHehl commented Oct 20, 2023

That was my approach, which I originally wanted to do as a PR. I don't think this is that complex. But of course I understand that people are a bit cautious when it comes to changing the constructors.

image

@titusfortner
Copy link
Member

You proposed a new constructor for the driver to take advantage of this, though, which means you end up needing to add the parameter as an option for all the current driver constructors for all the drivers which is prohibitive.

@titusfortner
Copy link
Member

We aren't going to do this, but if we implement #13022 it address your needs.

@titusfortner titusfortner closed this as not planned Won't fix, can't repro, duplicate, stale Dec 28, 2023
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants