zerocode icon indicating copy to clipboard operation
zerocode copied to clipboard

Feature Request -Parameterization of file name in Step

Open automationuser-m opened this issue 3 years ago • 4 comments

Description : In order to execute performance tests, json has to be sent in the body request. There are more than 1000 json files that has to be used in the performance testing. Each file contains different data. File name consists of <<uuid-client.json>> format

We created custom java function that will scan the directory for list of files and parse the uuid so that it can be used in the testing scenario

Challenge: Zerocode step does not allow parameterization of file names For example, in below request, 40000000000000000123456789ABCDEF cannot be parameterize

Benefits: Adding this feature will allow execution of performance test using zerocode framework for the given scenario

Sample Steps:

//Generate geid by parsing list of files in directory name: get_geid url: ListFilesExecutor operation: getListOfGeid assertions: geid: $IS.NOTNULL body: $IS.NOTNULL

// Use geid to post the request header and body file name: post_endpoint url: /client method: POST request: headers: uuid: ${$.get_geid.response.geid} body: ${JSON.FILE:reusableContent/request/40000000000000000123456789ABCDEF-client.json} //Unable to parameterize this step, refer expected value below verify: status: 200

Expected step with parameterization so that correct json file is added in the body based in geid name: post_endpoint url: /client method: POST request: headers: uuid: ${$.get_geid.response.geid} body: ${JSON.FILE:reusableContent/request/${$.get_geid.response.geid}-client.json} ** verify: status: 200

If there is any workaround available until this feature is implemented, please let us know.

automationuser-m avatar Apr 22 '22 21:04 automationuser-m

Hi, Do you want to you all of those JSON files in the same step?

sparrowV avatar Apr 27 '22 05:04 sparrowV

Currently there is not such functionality to execute step with N-times with different values. In that case, if one of the executions fails, should it fail the whole step?(According to your usecase)

For workaround, You can use custom function to make all the calls.

sparrowV avatar Apr 27 '22 13:04 sparrowV

I dont think there is built in way. @authorjapps do you know how this can be achieved?

sparrowV avatar Apr 27 '22 13:04 sparrowV

Thanks for response. I understand.

Executing same step N-times with different values functionality currently exists. It can be achieved by setting up thread count and use PerformanceTesting runner.

In above example, header accepts parameterized values. So step can be executed N-times with different values. The challenge in above use case is, JSON:FILE does not accept parametrized values i.e. we have to give fixed file path.

Can we please include feature in Zerocode that allows JSON:FILE to accept parameterized values ?

Regarding what happens when one step fails, since this use case will solve challenges in performance testing, if any execution fails, then that particular iteration should be marked as failed i.e. same as current Zerocode behaviour.

automationuser-m avatar Apr 27 '22 16:04 automationuser-m