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.

Take Screenshot doesn't process arguments correctly when run on failure

See original GitHub issue

Bug description Take Screenshot doesn’t process arguments correctly when it’s registered to be run on failure. Normally when called explicitly it’s working fine. Because of that as example unable to take fullPage screenshot.

Steps To Reproduce Look at my 2 code snippets below:

Take Screenshot not working correctly when registered to run on failure
    [Setup]  New Page  https://www.yahoo.com/
    Browser.Register Keyword To Run On Failure  Take Screenshot  fullPage=True
    Click  //button[@name="agree"]
    Wait Until Network Is Idle
    Wait For Elements State  ddd  state=visible
    [Teardown]  Close Page
Take Screenshot working correctly when explicitly called
   [Setup]  New Page  https://www.yahoo.com/
    Click  //button[@name="agree"]
    Wait Until Network Is Idle
    Take Screenshot  fullPage=True
    [Teardown]  Close Page

Expected behavior Take Screenshot should take full page screenshot for both examples.

Screenshots Incorrect - screenshot taken from viewport as default. Notice that filename was taken from the argument fullPage=True incorrect incorrect_argument_as_filename

Correct - full page screenshot. File name correct according to default filename argument correct correct_filename

Desktop:

  • OS: Windows 10 / docker image rfbrowser-stable:v8.0.1
  • Browser Chrome
  • Version 94.0.4606.61

Additional context Checked other KWs to be registered on failure with arguments like Log and they’re working correctly.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
aaltatcommented, Oct 15, 2021

As a workaround doing something like this should work https://github.com/MarketSquare/robotframework-browser/blob/main/atest/test/01_Browser_Management/run_on_failure.robot#L47

But there definitely is a bug.

0reactions
aaltatcommented, Oct 15, 2021

Lets move the discussion in #1396

Read more comments on GitHub >

github_iconTop Results From Across the Web

Taking screenshots on failure using Robot framework
I want to know how to capture screenshots on failure. Doesnt robot framework automatically take screenshots if script fails? An example will be ......
Read more >
[Fixed] Snipping Tool Not Working on Windows 10/11
Snipping Tool is useful and easy in producing screenshots, but sometimes it also fails to work properly. Looking for fixes?
Read more >
Fixed - Snipping Tool Not Working on Windows 10/8/7
If Snipping Tool is not working on your Windows 10, 8, 7 computer, you can try to fix it with 4 solutions listed...
Read more >
Capture screenshots for only failed tests in TestNG - YouTube
In this video, I have explained about "How to capture screenshots for only failed tests in TestNG".Points covered in this video:1.
Read more >
screenshot - Cypress Documentation
Take a screenshot of the application under test and, optionally, the Cypress Command Log. Syntax Usage Correct Usage Arguments fileName (String) A 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