Is there a way to avoid screenshots?

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:

	${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.

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

1 Like

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

Hi Tatu,

Thank you very much, that solved my issue.

Dave.

1 Like