Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

XRay - Post Test Step API give out of START_ARRAY token error

Elie El-Tawil October 21, 2018

I'm getting this error when posting a simple JSON 

[{"step":"Click Action dropdown >> Add Person","data":"\n"}]

to the 

rest/raven/1.0/api/test/MyTestID/step/1

 

...any ideas?? Is it my Json file ?? I'm doing in in Java using unirest package with latests Xray version.

 

 

"stack-trace" -> "org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of com.xpandit.raven.rest.api.teststep.beans.TestStepBean out of START_ARRAY token
at [Source: org.apache.catalina.connector.CoyoteInputStream@30fefdd3; line: 1, column: 1]
at org.codehaus.jackson.map.JsonMappingException.from(JsonMappingException.java:163)
at org.codehaus.jackson.map.deser.StdDeserializationContext.mappingException(StdDeserializationContext.java:219)
at org.codehaus.jackson.map.deser.StdDeserializationContext.mappingException(StdDeserializationContext.java:212)
at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromArray(BeanDeserializer.java:875)
at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:597)
at org.codehaus.jackson.map.ObjectMapper._readValue(ObjectMapper.java:2704)
at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1315)
at org.codehaus.jackson.jaxrs.JacksonJsonProvider.readFrom(JacksonJsonProvider.java:419)
at com"

1 answer

1 accepted

0 votes
Answer accepted
Matthias Gaiser _K15t_
Community Champion
October 21, 2018

Hi @Elie El-Tawil,

have a look at the documentation of their REST API to see if you call the correct endpoint with the correct data.

The endpoint you're calling is available for editing an existing test step. Since this is about editing one test step, you should not send an array, but only a single element to it, so your request should look like this (without the square brackets):

{"step":"Click Action dropdown >> Add Person","data":"\n"}

Cheers,
Matthias.

Elie El-Tawil October 22, 2018

Thanks the problem was those square brackets!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events