Forum Discussion
MauraR
13 years agoOccasional Contributor
hello, first of all thanks for this post. i'm new to rest and groovy and i find this very helpful. however, i'm blocked on step 3 - post request using the loaded test parameter
these are what i did:
1. step 1 - datasource as Excel
2. step 2 - groovy script, content as follows
def zql_query = context.expand( '${Excel#zql_query}' )
def filter_name = context.expand( '${Excel#filter_name}' )
def desc = context.expand( '${Excel#desc}' )
def is_favorite = context.expand( '${Excel#is_favorite}' )
def share_type = context.expand( '${Excel#share_type}' )
def jsonMessage = '{"ZQL_QUERY":"'+ zql_query + '","FILTER_NAME":"'+ filter_name + '","DESCRIPTION":"'+ desc + '","IS_FAVORITE":"'+ is_favorite + '","SHARE_TYPE":"'+ share_type + '"}'
testRunner.testCase.setPropertyValue( "JSONMessageProperty", jsonMessage )
3. step 3 - REST POST
i have no idea how to connect step 2 to step 3. can you please help?
thanks much!
-MR
these are what i did:
1. step 1 - datasource as Excel
2. step 2 - groovy script, content as follows
def zql_query = context.expand( '${Excel#zql_query}' )
def filter_name = context.expand( '${Excel#filter_name}' )
def desc = context.expand( '${Excel#desc}' )
def is_favorite = context.expand( '${Excel#is_favorite}' )
def share_type = context.expand( '${Excel#share_type}' )
def jsonMessage = '{"ZQL_QUERY":"'+ zql_query + '","FILTER_NAME":"'+ filter_name + '","DESCRIPTION":"'+ desc + '","IS_FAVORITE":"'+ is_favorite + '","SHARE_TYPE":"'+ share_type + '"}'
testRunner.testCase.setPropertyValue( "JSONMessageProperty", jsonMessage )
3. step 3 - REST POST
i have no idea how to connect step 2 to step 3. can you please help?
thanks much!
-MR