cancel
Showing results for 
Search instead for 
Did you mean: 

Truncate value once it's been extracted as a property before passing to subsequent request?

Community Hero

Truncate value once it's been extracted as a property before passing to subsequent request?

Hey!

 

Sorry - I'm posting a lot today.

 

I have a GET request that I need to test and the query parameters on the GET equate to the table attributes and values that will be queried via various different applications.

 

One of the attributes entitled 'EffectiveFrom' is an SQLServer datetime2(3) type - meaning if I do a GET on the table, each record has an EffectiveFrom value in the format '2017-01-01T00:00:00.0000000'

 

My testcase object hierarchy is as follows:

 

 

REST1 step (GET) http://whatevs.azurewebsites.net/api/database/table 

PropertyTransfer1 (grabs the EffectiveFrom attribute value from one of the records in the resultset passing  it to the Properties1 step)

Properties1 step (propertyname = 'EffectiveFrom', propertyvalue = '2017-01-01T00:00:00.0000000' 

REST2 step (GET) http://whatevs.azurewebsites.net/api/database/table?EffectiveFrom= ${Properties1#EffectiveFrom}

 

 

I get ZERO rows returned

 

HOWEVER - if I submit http://whatevs.azurewebsites.net/api/database/table?EffectiveFrom=2017-01-01 the query works and rows are retrieved

 

Does anyone know how I can effectively do a property transfer and truncate the value (stripping the time details) from the value so the following GET request works correctly?

 

 

I hope I've been clear, I know I struggle with this sometimes!

 

many thanks to all!

 

richie

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the title of the post to something more descriptive? This will help people when searching for problems.
3 REPLIES 3
Community Hero

Re: Truncate value once it's been extracted as a property before passing to subsequent request?

Did you manage to solve it so far?

 

If not, is the date always in the same format as in yyyy-mm-dd?



If my answer helped please click on the 'Accept as Solution' button.
Community Hero

Re: Truncate value once it's been extracted as a property before passing to subsequent request?

Hey @Lucian

 

thanks for responding - I discovered the developer of the API had actually coded a defect - hindering the return of the datetime value - so its all good

 

thanks man,

 

richie

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the title of the post to something more descriptive? This will help people when searching for problems.
Community Manager

Re: Truncate value once it's been extracted as a property before passing to subsequent request?

Hi Richie,

 

Do you mind posting the full solution so that other community members can find it easier?

We will mark it accordingly. Thanks!

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
New Here?
Join us and watch the welcome video:
Top Kudoed Authors