I want to have an ordered dictionary in Robot Framework. Is there any libraries which I can use for this purpose? How can I do that?
相关问题
- Import Java library in RIDE
- Problem with SELECT from database if using unicode
- How can I tell robot framework not to log a keywor
- How to trim or strip white spaces from a String wh
- Robot Framework AutoitLibrary run command does not
相关文章
- How to use robot framework with python in eclipse
- Saving class objects in robot framework
- How to handle dynamic elements using Robot Framewo
- How to feed a list of lists as an argument into a
- How to compare two images in Robot Framework
- Robotframework / Selenium2Library: Why does Drag A
- How to convert a tuple in robot framework into lis
- WebDriverException: Message: unknown error: cannot
I am not aware of any library that has a keyword to create an ordered dict, but creating an ordered dict is simple enough.
As of Python 2.7, there is an ordered dictionary available from Python. Robot Framework also defines one that is available in Python/Jython versions prior to 2.7. The Robot Framework OrderedDict has more features than the Python one.
Creating an ordered dict in Robot Framework would look like this:
In Python, using it would look like this:
Beware that the keywords from Collections were not designed with ordered dicts in mind. For instance
Get Dictionary Keys
sorts the keys. To workaround that, you can invoke the keys method directly:or
Similarly,
Get Dictionary Items
,Get Dictionary Values
, andLog Dictionary
involve sorting, possibly destroying the order of an OrderedDict.