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.

Keyword 'Take Screenshot' could not be run on failure: 'NoneType' object is not iterable

See original GitHub issue

Trying to get screenshot on failure, but getting only this message: Keyword 'Take Screenshot' could not be run on failure: 'NoneType' object is not iterable

In the same time if I explicitly putting keyword Take Screenshot im my .robot file screenshot is successfully saved.

I tried official image marketsquare/robotframework-browser and got the same behavior. requirements.txt:

robotframework==4.0
robotframework-browser==4.1.0

Robot-file:

*** Settings ***
Library  Browser
*** Settings ***
Suite Setup  Enter LK
*** Keywords ***
Enter LK
    new page  %{URL}
    get title  ==   Asserted title
    fill text  xpath=//input[@name='username']    %{USERNAME}
    click  "Enter"
    fill text  xpath=//input[@name='password']    %{PASSWORD}
    click  "Enter"
    wait for elements state  "Main"  timeout=10
*** Test Cases ***
Successeful login
    [Tags]  Smoke
    get element state  "Exit"   attached  ==  ${True}

What I’m doing wrong? A couple months ago it was working.

Update: when I wrote explicitly

        run_on_failure: str = "Browser.Take Screenshot",

instead of

        run_on_failure: str = "Take Screenshot",

in line 621 (https://github.com/MarketSquare/robotframework-browser/blob/master/Browser/browser.py#L621)

It saved screenshots but it doesn’t looks like correct behavior. Maybe there are mistakes in test setup?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Ivan-Feofanovcommented, Mar 27, 2021

It is hard to say, but would it be possible to see full stack trace from the test? You can get it by running tests with --loglevel trace .

Output isn’t changed. As my investigation shows it can happens because variable test_name here evaluates in None

0reactions
allcontributors[bot]commented, Mar 28, 2021

@Ivan-Feofanov

@Ivan- already contributed before to bug, bug

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix TypeError in Python: NoneType Object Is Not Iterable
The Python TypeError: NoneType Object Is Not Iterable error can be avoided by checking if a value is None or not before iterating...
Read more >
TypeError: 'NoneType' object is not iterable in Python
It means the value of data is None .
Read more >
Capture Page Screenshot' could not be run on failure
The error is pretty clear, the reason there is no screenshot is because robot framework's connection to the browser is broken, ...
Read more >
Python TypeError: 'NoneType' object is not iterable Solution | CK
The TypeError: 'NoneType' object is not iterable error is raised when you try to iterate over an object whose value is equal to...
Read more >
TypeError: 'NoneType' object is not iterable #1264 - GitHub
TypeError: 'NoneType' object is not iterable #1264 ... Screenshot of error, embedded text output, or Pastebin link to the error.
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