$chromeOptions = new ChromeOptions();
$chromeOptions->addArguments([
'--headless',
// or whatever arguments
]);
$capabilities->setCapability(
ChromeOptions::CAPABILITY_W3C,
$chromeOptions
);
Doesn't pass "goog:chromeOptions" capability to Chromedriver node when establishing a connection, because this code:
https://github.com/php-webdriver/php-webdriver/blob/main/lib/Remote/DesiredCapabilities.php#L169-L186
Doesn't try to cast ChromeOptions object under index ChromeOptions::CAPABILITY_W3C to an array.
The workaround is:
$chromeOptions = new ChromeOptions();
$chromeOptions->addArguments([
'--headless',
// or whatever arguments
]);
$capabilities->setCapability(
ChromeOptions::CAPABILITY_W3C,
$chromeOptions->toArray() // <<<<<<<<<<<<<<<<<<<<<<<<<<
);
but that's like super unintuitive, ok.
@gvlasov Hi, thanks for the report, however, removing the prepared template for bug report makes it for us much harder to take action and investigate.
What are the steps you use to start the browser? Could you please provide entire code you use to initialize the browser (not just the snippet with capabilities).
@OndraM You know these details you're asking for don't matter. This is just a missed case in library serialization code.
These information matter, because you didn't provide complete self-contained and reproducible bug report. Purpose of the template is to help users with providing all the relevant information. Please understand proper bug reports help us quickly understand when the bug appears and how we can fix it. Without these information, we can only guess - which could lead to not fixing the issue properly.
@OndraM Dude, everyone but you understands this bug, it is trivial if you actually read the report and not whine about it not conforming to some standard. I provided enough info and there are already changes being made from your team members who understand the issue. You seem to be attached to your bureaucracy a little too much and overestimate my level of investment in your library.
This is not about bureaucracy, but about effectiveness and increasing a chance of finding a solution to the issue.
In order to fix a bug, we need to know why it is happening, and this is hard without all the information. Actually, because this bug report does not contained all these information from template (for example - you nowhere mention whether you start new session using ChromeDriver::start() or RemoteWebDriver::create(), what is quite important information), we almost missed the actual probable root cause, and spend unnecessarily much time on this issue.
Please be aware that your attitude by ignoring the prepared template is quite disrespectful to time of people who all maintain this library as unpaid volunteers in their free time.
Also please avoid any further personal attacks and comment only to the point - with information relevant to the issue. Thank you.
@OndraM Dude, everyone but you understands this bug, it is trivial if you actually read the report and not whine about it not conforming to some standard. I provided enough info and there are already changes being made from your team members who understand the issue. You seem to be attached to your bureaucracy a little too much and overestimate my level of investment in your library.
Please be respectful we are spending our free time to answer the issue you opened and if we need more information then we just need it. We are the maintainers.
I hope to see you write better messages :)
Fixed in #852 and the fix will be part of the next release (1.10.0 probably).
Most helpful comment
Fixed in #852 and the fix will be part of the next release (1.10.0 probably).