WebDriver-factory & Chrome options

Good day,
In WebDriver factory, one is able to indicate Chrome capabilities.

As far as I understand, setting Chrome options are different from setting capabilities.

Am I able to pass Chrome options as well via the factory ?
Thank you in advance.
Albertus

to be more specific: I’d like to pass the current profile of Chrome to the webdriver:
in Python I use among others, the the following option-related statement:

options.add_argument(r’–user-data-dir=C:\Users\xxxxx\AppData\Local\Google\Chrome\User Data’)
driver = webdriver.Chrome(options=options)

Hi Aroodt,

I have to admit, the “options” vs. “capabilities” chapter in the Selenium API is highly confusing – we deliberately didn’t do any “simplification” attempts in the Selenium Nodes, in order not to add yet another layer of black box abstraction around it :slight_smile: .

Anyhow, setting “Chrome Options” is rather easy. You just need to add an object chromeOptions to the capabilities, and there you can add an args entry where you put your setting. A picture obviously describes this better:

Let me know how this works!

Best,
Philipp

Philipp,
Excellent - thank you.
Of course there is a follow-up question :slight_smile: Perhaps I’m not implementing it correctly?

So, after making sure I’m referencing the same version of chromedriver, than chrome running on my Windows computer. (I’m using KNIME 4.2.2)
I run into the fact that chrome does not seem to recognize the option. (I made sure that I copied the value exactly from my Python script which does run :frowning: :see_no_evil:

Thank you for taking to time to look into it.
Albertus

Hi Albertus,

it should be args instead of item 1. Can you try this?

–Philipp

Hahaha,
The dangers of trying a million options… is breaking what was already working :slight_smile:

It works perfectly - thank you VERY MUCH!

So, as a closing observation, adding more options - i suppose they are additional arguments, like:image

Glad to hear it works! :slight_smile:

So, as a closing observation, adding more options - i suppose they are additional arguments, like:

Indeed :+1:

Perfect, thanxs a mil!

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.