Reputation: 31
I tried to attach screen shot in robot framework using Take Screenshot Keyword got an error like in logs
Taking screenshot failed: Taking screenshots is not supported on this platform by default. See library documentation for details.
Make sure tests are run with a physical or virtual display"
I use "Take Screenshot product.jpg 80%" in robot framework Test Cases
*** Settings ***
Library File.py
Library SeleniumLibrary
Library SeleniumScreenshots
Library Screenshot
*** Test Cases ***
Add product to the Shopping Cart
Search the product in home page
Select first product
#Capture page screenshot product.png
Take Screenshot product.jpg 80%
Select the size of product
Select the product to shopping cart
Take Screenshot Cart.png 80%
Upvotes: 0
Views: 7294
Reputation: 386010
Take Screenshot
(assuming you're using the keyword from the Screenshots library) takes a picture of the physical screen rather than the browser window. It only works if you have an actual (or virtual) screen attached to the process that is running the tests.
From the documentation for the Screenshots library:
Notice that successfully taking screenshots requires tests to be run with a physical or virtual display.
Upvotes: 1