I gave a keyword which basically simulates moving across a chart and hovering over each point in the chart. I am using mouse over to do this. what I have seen is that at each mouse over, robot is taking a screenshot which results in a large number of unnecessary screenshots. any ideas why ?
Validate LE Chart
[Arguments] ${Expected_points_Count}
${points_count}= Get Element Count ${chart_points}
Log ${points_count}
Should Be Equal As Numbers ${points_count} ${Expected_points_Count}
${points}= Get WebElements ${chart_points}
@{metric_list}= Create List CPU Memory Disk Session Count Total
FOR ${point} IN @{points}
Mouse Over ${point}
Mouse Over ${point}
${status}= Run Keyword And Return Status Wait Until Page Contains Element ${chart_tooltip} timeout=0
IF ${status} != âFailâ
${metrics}= Get WebElements ${chart_tooltip_points}
FOR ${metric} IN @{metrics}
${text}= Get Text ${metric}
END
END
END
Is Wait Until Page Contains Element failing a lot? that would trigger the screenshots, perhaps increase the timeout to something larger than 0, maybe 0.1?
The most common reason for triggering screenshots is a keyword that fails, but usually only 1 because then the test fails and stops, unless there is a keyword that prevents the test failing when a keyword fails, especially when thatâs in a loop, thatâs why I pointed at that line.
Nothing elese in the test you showd jumps out as the likely cause. The screenshows should be embeded in the log.html as images, so youâll have to go through the log keyword by keyword and see where the screenshots are.
Maybe open log.html in a browser, open devtools and search the html for elements
Just another thought that I use, is to disable globally the screenshot on failure (especially if youâre using failed status/keyword to control your tests), and capture screenshot when test itself fail:
IF '${TEST_STATUS}' != 'PASS'
Capture Page Screenshot ${TEST_NAME}_Fail.png
END
This can be set in Teardown to ensure a screen is made for analysis purposes.