# Chrome options --headless=new

**URL:** <https://forum.robotframework.org/t/chrome-options-headless-new/6009>\
**Category:** SeleniumLibrary\
**Created:** [26 July 2023 23:36 UTC](https://forum.robotframework.org/t/chrome-options-headless-new/6009 "2023-07-26T23:36:19Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![wilsoft-gt](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/wilsoft-gt/32/2656_2.png) [@wilsoft-gt](https://forum.robotframework.org/u/wilsoft-gt)\
**Post date:** [26 July 2023 23:36 UTC](https://forum.robotframework.org/t/chrome-options-headless-new/6009/1 "2023-07-26T23:36:19Z")

</div>

Hi all, I’m trying to run a test case in headless mode with an extension, after checking it is possible by calling the argument like this:

–headless=new

The issue is that I’m using robot like so:

${chrome\_options}= Evaluate. sys.modules[‘selenium.webdriver’].CromeOptions() sys, selenium.webdriver

…  
Call Method ${chrome\_options}. add\_argument. --headless

That works fine and robot runs in headless mode, the issue is when I try to add the “new” paraneter to the “–headless” argument like so:

–headless=new

The error I get is:  
Calling method ‘add\_argument’ failed: TypeError: ArgOptions.add\_argument() got an unexpected keyword argument ‘–headless’

Any idea how to call that argument?

---

<div class="post-metadata">

**Author:** ![NikosKoul](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/nikoskoul/32/2512_2.png) [@NikosKoul](https://forum.robotframework.org/u/NikosKoul)\
**Post date:** [27 July 2023 08:15 UTC](https://forum.robotframework.org/t/chrome-options-headless-new/6009/2 "2023-07-27T08:15:06Z")

</div>

Hi Wilson,

I am trying to understand what you want to do by adding the argument new. Could you please give me more details?

btw this is my options for the setup and teardown:

```
***Keywords***
Begin Web Test
    ${options} Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys
    Call Method ${options} add_argument --disable-notifications
    Call Method ${options} add_argument --disable-infobars
    Call Method ${options} add_argument --disable-extensions
    Call Method ${options} add_argument --no-sandbox
    Call Method ${options} add_argument --headless
    Call Method ${options} add_argument --disable-dev-shm-usage
    SeleniumLibrary.Open Browser ${BASE_URL} Chrome options=${options}
    SeleniumLibrary.Set Window Size 1920 1080

End Web Test
    SeleniumLibrary.Close Browser

```

---

<div class="post-metadata">

**Author:** ![wilsoft-gt](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/wilsoft-gt/32/2656_2.png) [@wilsoft-gt](https://forum.robotframework.org/u/wilsoft-gt)\
**Post date:** [27 July 2023 15:08 UTC](https://forum.robotframework.org/t/chrome-options-headless-new/6009/3 "2023-07-27T15:08:52Z")

</div>

Hi @NikosKoul, my goal was to run the test in headless mode with a chrome extension as an example with salesforceinspector, without the “=new” option, there is no way to open the browser with a chrome extension in headless mode. I was able to fix this by adding the argument in this way:

–headless=new

Thank you for your replay.

---

<div class="post-metadata">

**Author:** ![NikosKoul](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/nikoskoul/32/2512_2.png) [@NikosKoul](https://forum.robotframework.org/u/NikosKoul)\
**Post date:** [28 July 2023 06:21 UTC](https://forum.robotframework.org/t/chrome-options-headless-new/6009/4 "2023-07-28T06:21:19Z")

</div>

This is smth I didn’t know it. Perfect!!!  
Happy to hear that you fixed it!

Have a nice day!

---

<div class="post-metadata">

**Author:** ![kosha](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/kosha/32/2740_2.png) [@kosha](https://forum.robotframework.org/u/kosha)\
**Post date:** [31 October 2023 07:29 UTC](https://forum.robotframework.org/t/chrome-options-headless-new/6009/5 "2023-10-31T07:29:55Z")

</div>

> [@wilsoft-gt](#):
>
> –headless=new

Hi,

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/2X/3/316679bdcd6122d29d017e26dbf44cb614ced66e.png)  
I’m still getting the same error… Do you mind sharing how did it work for you in headless mode and did it work with jenkins?

---

<div class="post-metadata">

**Author:** ![\_daryl](https://avatars.discourse-cdn.com/v4/letter/_/45deac/32.png) [@\_daryl](https://forum.robotframework.org/u/_daryl)\
**Post date:** [31 October 2023 11:13 UTC](https://forum.robotframework.org/t/chrome-options-headless-new/6009/6 "2023-10-31T11:13:52Z")

</div>

@kosha Probably because you are using a single hyphen/dash `-` not two hyphens/dashes `--` could be wrong though.  
Hopefully that helps from a glance (:

---

<div class="post-metadata">

**Author:** ![wilsoft-gt](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/wilsoft-gt/32/2656_2.png) [@wilsoft-gt](https://forum.robotframework.org/u/wilsoft-gt)\
**Post date:** [31 October 2023 14:27 UTC](https://forum.robotframework.org/t/chrome-options-headless-new/6009/8 "2023-10-31T14:27:26Z")

</div>

Hi, you need to escape the equal sign, the forum is deleting the backslash in my response:

-headless/=new  
(Replace the forward for the backslash)

In any case the forum deletes any sign sould be like this:

[dash][headless][backslash][equal][new]

Hope that works for you.

---

<div class="post-metadata">

**Author:** ![kosha](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/kosha/32/2740_2.png) [@kosha](https://forum.robotframework.org/u/kosha)\
**Post date:** [2 November 2023 22:31 UTC](https://forum.robotframework.org/t/chrome-options-headless-new/6009/9 "2023-11-02T22:31:14Z")

</div>

Hi …it didnt work Call Method ${chrome\_options} add\_argument -headless/=new

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/2X/8/89aa63b4f374b338ff46994d8cd53f1229d40ab4.png)  
 ![image](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/2X/3/349c4c8d2d068d4d09610c8512833e445903ab2e.png)  
Also it returns blank page here  
 ![image](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/2X/b/b9f9fa6099c0913c18ef39f034acf755ad0e97d8.png)  
Call Method ${chrome\_options} add\_argument -headless/  
\*\*\* Variables \*\*\*  
${BROWSER} headlesschrome

---

<div class="post-metadata">

**Author:** ![wilsoft-gt](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/wilsoft-gt/32/2656_2.png) [@wilsoft-gt](https://forum.robotframework.org/u/wilsoft-gt)\
**Post date:** [2 November 2023 22:51 UTC](https://forum.robotframework.org/t/chrome-options-headless-new/6009/10 "2023-11-02T22:51:53Z")

</div>

My bad, the argument sould be called with double dash like the others you already have.

---

<div class="post-metadata">

**Author:** ![swap12875](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@swap12875](https://forum.robotframework.org/u/swap12875)\
**Post date:** [18 March 2025 15:20 UTC](https://forum.robotframework.org/t/chrome-options-headless-new/6009/11 "2025-03-18T15:20:11Z")

</div>

Hi There,

BTW, I am able to fix this in my machine  
with this code,

```
${headless_arg} Set Variable headless=new
Call Method ${chrome options} add_argument --${headless_arg}

```

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/2X/9/9bfaf7c5d3cb2fa9a958cbde0be2c04c0d9fed5f.png)
