Selenium2Library keyword "Capture Page Screenshot" - can it take a folder as argument?

1,165 views
Skip to first unread message

Tset Noitamotua

unread,
Sep 18, 2015, 7:00:27 AM9/18/15
to robotframework-users
Hi guys!

I would like to specify the folder where the screenshots are saved when I use 'run_on_failure=Capture Page Screenshot' setting on library import.

For that I packed 'Capture Page Screenshot' in my own user keyword 'Capture Screenshot'

***Settings***
| Library | Selenium2Library | run_on_failure=Capture Screenshot


***Keywords***
| Capture Screenshot
| | Capture Page Screenshot | | error_screenshots/error.png

Q1. Of corse that way the filename has no counter. How can I add a counter or a timestamp to the filename or give only a folder as argument to keyword 'Capture Page Screenshot'?

Q2. Another question (which is a little offtopic). How can one add a timestamp to the results folder where log.html, report.html etc are save? I set this folder with the '-d' or '--outputdir' option when I start the test from command line.

Cheers
Tset

Tatu Aalto

unread,
Sep 19, 2015, 2:59:05 AM9/19/15
to Wladislaw Wagner, robotframework-users

1) If you install S2L from source, it has commit [1] to add index in the filename with Capture Page Screenshot keyword. Please see the keyword documentation for better details.

2) I usually do it with a script. Create required folder in the scrip and use the folder as input to the --outputdir option.

-Tatu
Send from my mobile
[1] https://github.com/robotframework/Selenium2Library/commit/918e9d3a52c5fdb990703bd279260e0c47e87670

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at http://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

Tset Noitamotua

unread,
Nov 13, 2015, 5:02:06 PM11/13/15
to robotframework-users
Thank you,Tatu!
Meanwhile In Selenium2Library 1.7.4 the issue with the folder for screenshots is already implemented, right?

And when using Jenkins one actually does not need to take care of the created artifacts as Jenkins does it for me. Thus artifacts can be overwritten on each test run and it does not hurt because the last results are backed up on Jenkins server.

Cheers
Tset




Reply all
Reply to author
Forward
0 new messages