# Is there a way to avoid screenshots?

**URL:** <https://forum.robotframework.org/t/is-there-a-way-to-avoid-screenshots/1961>\
**Category:** SeleniumLibrary\
**Created:** [20 June 2021 00:53 UTC](https://forum.robotframework.org/t/is-there-a-way-to-avoid-screenshots/1961 "2021-06-20T00:53:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [20 June 2021 00:53 UTC](https://forum.robotframework.org/t/is-there-a-way-to-avoid-screenshots/1961/1 "2021-06-20T00:53:44Z")

</div>

HI All,

I have some tasks that navigate through various sites, one of these sites that most tasks goes to requires a login (always the same userid), but as i’m reusing the browser for the suite of tasks so if a previous task already logged in, when I return to the site, my login is retained.

At the moment I do the following to detect wait for the page to load and detect if i’m logged in:

```python
	${dologin} =	Run Keyword And Return Status	Wait Until Page Contains Login

```

If it’s the first task to load the site the login runs as soon as the page loads, if not the script continues after 5 seconds timeout and this works well for me, the only problem is I get a screen shot every time.

What I would like to know, is there a way to tell the selenium library not to take a screen shot for only the next keyword? or some way to turn on and off the screenshots?

In some other places where I need to test for a condition I use `Get WebElements` which doesn’t take a screen shot but it runs immediately and doesn’t have a timeout allowing time for the element to load.

Also are there other keywords in SeleniumLibrary that don’t take screenshots?

Dave.

---

<div class="post-metadata">

**Author:** ![aaltat](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/aaltat/32/15_2.png) [@aaltat](https://forum.robotframework.org/u/aaltat)\
**Post date:** [21 June 2021 05:46 UTC](https://forum.robotframework.org/t/is-there-a-way-to-avoid-screenshots/1961/2 "2021-06-21T05:46:32Z")

</div>

Have you seen this [https://robotframework.org/SeleniumLibrary/SeleniumLibrary.html#Run-on-failure%20functionality](https://robotframework.org/SeleniumLibrary/SeleniumLibrary.html#Run-on-failure%20functionality)

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [21 June 2021 05:58 UTC](https://forum.robotframework.org/t/is-there-a-way-to-avoid-screenshots/1961/3 "2021-06-21T05:58:23Z")

</div>

Hi Tatu,  
I hadn’t seen that, thanks I will try it.  
Dave.

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [21 June 2021 22:34 UTC](https://forum.robotframework.org/t/is-there-a-way-to-avoid-screenshots/1961/4 "2021-06-21T22:34:10Z")

</div>

Hi Tatu,

Thank you very much, that solved my issue.

Dave.

---

<div class="post-metadata">

**Author:** ![raj330](https://avatars.discourse-cdn.com/v4/letter/r/e19adc/32.png) [@raj330](https://forum.robotframework.org/u/raj330)\
**Post date:** [4 December 2021 17:08 UTC](https://forum.robotframework.org/t/is-there-a-way-to-avoid-screenshots/1961/6 "2021-12-04T17:08:39Z")

</div>

Hi, could you please let me know, where to add run\_on\_failure=Nothing""?

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [5 December 2021 02:51 UTC](https://forum.robotframework.org/t/is-there-a-way-to-avoid-screenshots/1961/7 "2021-12-05T02:51:07Z")

</div>

It depends where you need it, in my case I put it just before the logon keyword and just after I put it back to default, what you need to do will depend on your AUT.

Dave.

---

<div class="post-metadata">

**Author:** ![mohdl](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/mohdl/32/2575_2.png) [@mohdl](https://forum.robotframework.org/u/mohdl)\
**Post date:** [3 May 2023 14:35 UTC](https://forum.robotframework.org/t/is-there-a-way-to-avoid-screenshots/1961/8 "2023-05-03T14:35:30Z")

</div>

Hi,  
I’m trying to use the keyword run\_on\_failure and set it to nothing but it says that the keyword is not defined, anyone have any idea what’s the issue? I’m just curious about the problem here.  
Also btw I solved the issue with the screenshots following this article which might be a neater solution.  
[https://www.formulatedautomation.com/post/how-to-avoid-huge-log-files-in-robot-framework](https://www.formulatedautomation.com/post/how-to-avoid-huge-log-files-in-robot-framework)

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [4 May 2023 04:47 UTC](https://forum.robotframework.org/t/is-there-a-way-to-avoid-screenshots/1961/9 "2023-05-04T04:47:09Z")

</div>

Hi Mohamed,

perhaps [No Operation](https://robotframework.org/robotframework/latest/libraries/BuiltIn.html#No%20Operation) is what you want.

Dave.
