question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add SeleniumLibrary Set Screenshot Directory keyword counterpart

See original GitHub issue

Is your feature request related to a problem? Please describe.

I am working in a project, where we would like to redefine the output directory of Take Screenshot keyword. Currently the path can´t be changed. Therefore we would like the library to have a common keyword to set the screenshot directory path.

Describe the solution you’d like

A SeleniumLibrary Set Screenshot Directory keyword counterpart could to be added to Browser library. Then it would be possible to define needed screenshot related setting with two library keywords. Like this:

Configure Screenshot Settings
   Browser.Set Screenshot Directory    ${WANTED_SCREENSHOT_DIRECTORY_PATH}
   Browser.Take Screenshot             filename=robotframework-browser-screenshot-{index}

Describe alternatives you’ve considered

Adding a path argument to Take Screenshot keyword could also be an option.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
leeuwecommented, Mar 7, 2021

Hi @Virvatuli. In my experience Browser.Take Screenshot already takes a full path, meaning you can easily create your own userkeyword to achieve this, like:

Make Screenshot
    [arguments]       ${filename}=robotframework-browser-screenshot-{index}     ${selector}=None
    ${ImgDir}=        Set Variable                  ${EXECDIR}${/}mydir${/}
    Take Screenshot   ${ImgDir}${filename}          ${selector}
1reaction
Virvatulicommented, Mar 8, 2021

@leeuwe Thank you for your reply and advice on this matter. I managed to implement your given solution to our project and it works nicely. I didn´t realize you can do this by just reading the keyword’s documentation, but I am still a beginner.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SeleniumLibrary - Robot Framework
SeleniumLibrary is a web testing library for Robot Framework. This document explains how to use keywords provided by SeleniumLibrary.
Read more >
RobotFramework / Selenium: How to set screenshot-name to ...
The documentation for SeleniumLibrary's Capture Page Screenshot shows that you can give it a filename as the first argument.
Read more >
ExtendedSelenium2Library
This keyword is a reimplementation of the basic functionality of the id locator where ${browser} is a reference to the WebDriver instance and...
Read more >
SeleniumLibrary
Keywords ; Unselect From List By Value, locator, *values. Unselect the given *values of the multi-select list identified by locator . Select list...
Read more >
RPA.Browser.Selenium library | Robocorp documentation
By default, locators are considered to use the keyword specific default locator strategy. All keywords support finding elements based on id and name...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found