Getting error while using Set To Dictionary keyword in robot framework
Code:
Set To Dictionary ${Data Provider} name Sujit
I am getting following error while using Set To Dictionary Keyword
TypeError: 'str' object does not support item assignment
Your ${Data Provider} variable needs to be a dictionary, not a string. Provided that you've imported the Collections library, you can declare a dictionary with the Create Dictionary keyword.
Example:
${Data Provider} Create Dictionary
Set To Dictionary ${Data Provider} name Sujit
Log ${Data Provider}
You can also initialise a dictionary with values directly:
${Data Provider} Create Dictionary name Sujit
Log ${Data Provider}
Both of these examples would log INFO : ${Data Provider} = {u'name': u'Sujit'}. Find more information about the Collections library here: http://robotframework.googlecode.com/hg/doc/libraries/Collections.html?r=2.8.5
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With