If resource name contains a "Space" i am getting an error #63

Closed
GurpreetKaurJaggi opened this Issue Jul 17, 2013 · 7 comments

2 participants

@GurpreetKaurJaggi

Hi,

I am trying to go to a particular resource that contains a space in it , however i am getting an error while fetching the information because of the space in the resource name .

Is there any workaround to fetch the data from a resource that contains space in it

@smartrics
Owner

Can you provide an example of the uri you are trying to GET?

@GurpreetKaurJaggi
@GurpreetKaurJaggi

Hi Fabrizo,

It would be great if you could look into this , as i am currently blocked on a very important task because of this issue.

Let me know if you need any more information

Thanks,
Gurpreet

@smartrics
Owner

If your response is like this, for example:

{"Object":
{"monitor name": {"id":1,"name":"M1"} }
}

try

jsonbody.Object["monitor name"].id == 1

@GurpreetKaurJaggi

Hi ,

Fabrizo,

I am trying to get the value of the resource from the response by navigating the Xpath .

However my resource name contains a space , as mentioned "monitor name".

Also i tried using ["monitor name"] or [monitor name], however it still does not work .
Here is what i get :-

monitoringalias:monitorResult/monitoringalias:[monitor name]/monitoringalias:queues/monitoringalias:queueData/monitoringalias:queue_id[text()]
xPath expression can not be compiled: monitoringalias:monitorResult/monitoringalias:[monitor name]/monitoringalias:queues/monitoringalias:queueData/monitoringalias:queue_id[text()] null

Please suggest . !!

@GurpreetKaurJaggi

Hi,
Fabrizo ,

Any updates on this ?

Thanks,
Gurpreet

@smartrics
Owner

you should use JSON dot notation. why do you want to use XPaths? RestFixture isn't supporting XPaths on JSON anymore.

in any case i am not sure if spaces are allowed as part of xml element names. so the xpath may be invalid irrespective

@smartrics smartrics closed this Aug 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment