Error: AttributeError: 'unicode' object has no attribute 'items' #18

Closed
snsamitdengale opened this Issue Dec 5, 2013 · 1 comment

Projects

None yet

2 participants

@snsamitdengale

Hi,
I don't have a request API testing experience so I am new in this field.
I am trying to post a request which contains huge data in input json
I have followed all the steps given in https://github.com/bulkan/robotframework-requests/blob/master/tests/testcase.txt#L12
I have created a testcase for post

Create Session test URL
${headers} Create Dictionary Content-Type application/json
Set Suite Variable ${data} { "elementToken":"token", "matchCriteria":[{"field":"name","dataType":"string","fieldValue":"Trial", "operator": "equalTo"}], "account": { "annual.Revenue": "456666", "name": "Trial", "numberOfEmployees": "integer", "billing.Address": { "city": "Miami", "country": "US", "countyOrDistrict": "us or fl", "postalCode": "33131", "stateOrProvince": "florida", "street1": "Trade Center", "street2": "North Main rd" }, "shipping.Address": { "city": "denver", "country": "us", "countyOrDistrict": "us or co", "postalCode": "80202", "stateOr.Province": "colorado", "street1": "Main street", "street2": "101 Avenu" } } }
${resp} Post test / data=${data} header=${headers}
Should Be Equal As Strings ${resp.status_code} 200

When I am trying to run the test case, getting error as "AttributeError: 'unicode' object has no attribute 'items'".
I know it's related to ${data}
I even tried to create a list and tried to append the data but it's in vain.

Can you figure out the problem?

Thanks in advance.

@bulkan bulkan pushed a commit that referenced this issue Dec 5, 2013
Bulkan Evcimen created testcase for #18 a5e017c
@bulkan
Owner
bulkan commented Dec 5, 2013

Hi @snsamitdengale

No problem at all.

I created a test case using your data. See https://github.com/bulkan/robotframework-requests/blob/master/tests/issues/18.txt

I am open to suggestions and pull requests for making the usage of this library easier simpler.

Hope that helps.

@bulkan bulkan closed this Dec 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment