# Test fails in headless mode

**URL:** <https://forum.robotframework.org/t/test-fails-in-headless-mode/6885>\
**Category:** SeleniumLibrary\
**Created:** [22 February 2024 11:14 UTC](https://forum.robotframework.org/t/test-fails-in-headless-mode/6885 "2024-02-22T11:14:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abdullah92](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@Abdullah92](https://forum.robotframework.org/u/Abdullah92)\
**Post date:** [22 February 2024 11:14 UTC](https://forum.robotframework.org/t/test-fails-in-headless-mode/6885/1 "2024-02-22T11:14:29Z")

</div>

Hello all,  
I have some tests that run correctly in default mode for browser but it fails when running in headless mode

---

<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:** [22 February 2024 16:18 UTC](https://forum.robotframework.org/t/test-fails-in-headless-mode/6885/2 "2024-02-22T16:18:59Z")

</div>

Hi @Abdullah92

Youve not mentioned what library you are using nor gave any indication on the exception your getting, plus youve created your post under robotframework category rather than browser or selenium, so theres no knowing which library.

The solution to your problem could be as simple as slowing down your execution with assertions, …ie if **browserlibrary** [Wait For Elements State](https://marketsquare.github.io/robotframework-browser/Browser.html#Wait%20For%20Elements%20State) and if **seleniumlibrary** [Wait Until Element Is Visible](https://robotframework.org/SeleniumLibrary/SeleniumLibrary.html#Wait%20Until%20Element%20Is%20Visible) but there are many keywords you can use.

But ideally, for any help to be given, knowing the library and the exception will help with the answers you will get from anyone.

Thanks.

---

<div class="post-metadata">

**Author:** ![Abdullah92](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@Abdullah92](https://forum.robotframework.org/u/Abdullah92)\
**Post date:** [22 February 2024 16:32 UTC](https://forum.robotframework.org/t/test-fails-in-headless-mode/6885/3 "2024-02-22T16:32:23Z")

</div>

Thanks daryl,  
I’m using selenium library and already appling waits techniques.

---

<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:** [22 February 2024 16:35 UTC](https://forum.robotframework.org/t/test-fails-in-headless-mode/6885/4 "2024-02-22T16:35:24Z")

</div>

Does that mean your problem is solved? or could you provide the exception in question? It would also be worth seeing the logic around where the exception is being thrown (so, if possible, just a small code snippet)  
Thanks

---

<div class="post-metadata">

**Author:** ![rasjani](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@rasjani](https://forum.robotframework.org/u/rasjani)\
**Post date:** [22 February 2024 19:28 UTC](https://forum.robotframework.org/t/test-fails-in-headless-mode/6885/5 "2024-02-22T19:28:26Z")

</div>

What keyword fails and with what browser ?
