Unable to merge DesiredCapabilities in qaf-4.0.0-RC3

23 views
Skip to first unread message

Shiv

unread,
Nov 5, 2024, 5:29:38 AM11/5/24
to qaf users

qaf-4.0.0-RC3 and Selenium 4.25.0

Description:
Set headless in chrome options and merge the capabilities in WebDriverListener.
But the chrome driver still opens the chrome browser.
we expect the chrome works in headless mode.

Steps To Reproduce
  1. create chrome options as below code snippet:
    public class WebDriverListener extends QAFWebDriverCommandAdapter{
    DesiredCapabilities cap = new DesiredCapabilities();
    @OverRide
    public void beforeInitialize(Capabilities desiredCapabilities){
    super.beforeInitialize(desiredCapabilities);
    ChromeOptions options = new ChromeOptions();
    options.addArguments("--remote-allow-origins=*");
    options.addArguments("--headless=new");
    cap.setCapability(ChromeOptions.CAPABILITY,options);
    desiredCapabilities.merge(cap);
    }}
  2. run the case to try to open a website.
Expected behavior

chrome browser should not be opened.

Actual behavior

it opens a chrome browser



Anybody has solution for this in QAF 4.0.0-RC3?

Amit Bhoraniya

unread,
Nov 7, 2024, 10:40:48 AM11/7/24
to qaf-...@googlegroups.com
Hi Shiv,

You can specify such chrome options via property itself.

chrome.additional.capabilities={"goog:chromeOptions":{"args":["--headless","--window-size=1920,1080"]}}

Refer:
https://github.com/qmetry/qaf/issues/407

Thanks
Amit Bhoraniya

--
You received this message because you are subscribed to the Google Groups "qaf users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qaf-users+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/qaf-users/49c33cca-8f5b-47e5-9c9c-a5ce44383e80n%40googlegroups.com.

Shivagiri

unread,
Nov 8, 2024, 6:01:25 AM11/8/24
to qaf-...@googlegroups.com
Hi Amit
I am facing issue  is with qaf-4.0.0-RC3 version of QAF with selenium v4.25.0.

It works fine with QAF 3.1.0 with selenium 3.6.x..



Thanks & Regards

         Shiv



This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.





Shiv

unread,
Nov 25, 2024, 4:44:33 AM11/25/24
to qaf users
Defining this way via property file it work  chrome.additional.capabilities={"goog:chromeOptions":{"args":["--headless","--window-size=1920,1080"]}}

However its not working when try to set at run time using -->public void beforeInitialize(Capabilities desiredCapabilities){}
This issue with selenium 4.x.x with  qaf-4.0.0-RC3 
Note- With selenium  3.x.x with qaf 3.1.0 it works with -->public void beforeInitialize(Capabilities desiredCapabilities){} also. 
Reply all
Reply to author
Forward
0 new messages