New headless mode not working

I being trying to use the new headless mode for Google Chrome but I don’t know what I maybe be doing wrong.

This is my suite_setup.robot

*** Settings ***
Library             SeleniumLibrary
Library             String
Library             Collections
Library             OperatingSystem
Library             DateTime
Library             FakerLibrary  locale=pt_BR

*** Variables ***
${HEADLESS}=  ${HEADLESS}
${TEARDOWN}=  True
${URL}=  ${URL}
${FAST_TIMEOUT}=  5
${TIMEOUT}=  30
${LONG_TIMEOUT}=  60
${HARD_TIMEOUT}=  90

*** Keywords ***

Open Chrome
    ${CHROME_OPTIONS}=  Evaluate  selenium.webdriver.ChromeOptions()
    Call Method    ${CHROME_OPTIONS}    add_argument    --incognito    
    Call Method    ${CHROME_OPTIONS}    add_argument    --disable-notifications   
    Call Method    ${CHROME_OPTIONS}    add_argument    --new-window   
    Call Method    ${CHROME_OPTIONS}    add_argument    --aggressive-cache-discard        
    Call Method    ${CHROME_OPTIONS}    add_argument    --disable-application-cache  
    Call Method    ${CHROME_OPTIONS}    add_argument    --disable-dev-shm-usage
    Call Method    ${CHROME_OPTIONS}    add_argument    --no-sandbox
    Call Method    ${CHROME_OPTIONS}    add_argument    --disable-gpu
    Call Method    ${CHROME_OPTIONS}    add_argument    --mute-audio
    Call Method    ${CHROME_OPTIONS}    add_argument    --start-maximized
    Run Keyword If  ${HEADLESS}==True   With Headless     ${CHROME_OPTIONS}
    Run Keyword If  ${HEADLESS}==False  Without Headless  ${CHROME_OPTIONS}

With Headless
    [Arguments]  ${CHROME_OPTIONS}
    Call Method    ${CHROME_OPTIONS}    add_argument    --headless=new
    Open Browser    ${URL}    chrome    options=${CHROME_OPTIONS}
    Set Window Size    1920    1080

Without Headless
    [Arguments]  ${CHROME_OPTIONS}
    Open Browser    ${URL}    chrome   options=${CHROME_OPTIONS}

As soon I run the following command robot -d ./results -v HEADLESS:True ./Cases I get this error in the terminal: Calling method 'add_argument' failed: TypeError: ArgOptions.add_argument() got an unexpected keyword argument '--headless'.

This is my requirements I’m using:

Faker==4.16.0
python-dateutil==2.8.1
robotframework==6.0.2
robotframework-faker==5.0.0
robotframework-pabot==2.15.0
robotframework-pythonlibcore==4.1.2
robotframework-seleniumlibrary==6.1.0
selenium==4.9.0
six==1.12.0
text-unidecode==1.3
urllib3==1.26.10
wrapt==1.12.1
qase-robotframework==1.1.1

As far I as know the new headless mode is very easy to use. For example in the below test:

*** Settings ***
Library           SeleniumLibrary

*** Test Cases ***
Testing  Headless Chrome
    Open Browser    https://robotframework.org/    headlesschrome
    Sleep    5 seconds
    Capture Page Screenshot
    Close Browser

@HelioGuilherme66 I saw this option in the selenium documentation but I thought it still use the old headless mode. I was trying using the parameter headless=new because it is in the Google documentation.

OK, but the RF community always try to make things simpler :slight_smile:

I have not been able to get the new functionality from Google to work with robot framework. That is using headlesschrome argument or headless=new. And with the new drivers from chrome the headlesschrome does not longer seem to work as they did a couple of months back.
I’m probably just confused on what to use as of right now and hopefully I will get some clarity here at this forum in the future.

We started using headlesschrome here but the problems we had with the “normal” were still happening. For now, we have 6-7 test cases running with Firefox. For some reason, the headless firefox works in some way different than chrome.