Keyword 'Take Screenshot' could not be run on failure: 'NoneType' object is not iterable
See original GitHub issueTrying 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:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Output isn’t changed. As my investigation shows it can happens because variable
test_name
here evaluates inNone
@Ivan-Feofanov
@Ivan- already contributed before to bug, bug