So I was trying my hand at this with JSON : Robot Framework User Guide
So at first, I just copied the code provided in the documentation :
from robot.running import TestSuite # Create suite based on data on the file system. suite = TestSuite.from_file_system('/path/to/data') # Get JSON data as a string. data = suite.to_json() # Save JSON data to a file with custom indentation. suite.to_json('data.rbt', indent=2)
Unfortunately I have the following error when I run it :
AttributeError: type object 'TestSuite' has no attribute 'from_json'
When I try to do the opposite (meaning creating a suite from JSON), Pycharm automatically underline the
TestSuite.from_json with the following warning :
Unresolved attribute reference 'from_json' for class 'TestSuite'
I absolutely don’t know why it doesn’t recognize the attributes given it is an exemple from the documentation and I did nothing. I even changed the import, making it
import from robot.api, the problem is still the same.
Any guess on where the problem originates from ?