cancel
Showing results for 
Search instead for 
Did you mean: 

Need help in acheiving dynamic data load and filter back response from file

Apoorva6
Frequent Contributor

Need help in acheiving dynamic data load and filter back response from file

I have 2 test steps. (note that inbetween these two, there are many transactions triggered) . The attachment has detailed steps. It has STEP1 and STEP2.

 

STEP1: Request1 when triggered must write the account numbers to already existing file. then to give back Response1

 

STEP2: Request1 to filter the response from file and get only filtered data back, to get Response1.

 

We cannot transfer any property from STEP1 to STEP2, as there are many transactions in between. I guess we need to work on Request/Response dispatcher only . Please help.

8 REPLIES 8
nmrao
Community Hero

Re: Need help in acheiving dynamic data load and filter back response from file

Is it just fixed response for fixed request? Any conditions?


Regards,
Rao.
Apoorva6
Frequent Contributor

Re: Need help in acheiving dynamic data load and filter back response from file

Hi Rao,

 

Initial file will be fixed. In STEP1 account numbers to be written to that file will be dynamic which is BillingAccountNumber. Later in STEP2, same Request to get filtered Response back with the account numbers.

nmrao
Community Hero

Re: Need help in acheiving dynamic data load and filter back response from file

The accurate information in the question will have better results.
Just one thing it is noticed that both requests are different, i.e., represent different operations.
It would be better if you can show mapping between each request and respone i.e., which value of the request (put place holder) goes to which value of the response (put place holder). Do the same for both requests and responses.



Regards,
Rao.
nmrao
Community Hero

Re: Need help in acheiving dynamic data load and filter back response from file

Also note that, here you must be implementing two mock operations -

1. BillAccountPackageReadResponse
2. BillAccountWriteResponse


Regards,
Rao.
Apoorva6
Frequent Contributor

Re: Need help in acheiving dynamic data load and filter back response from file

Hi Rao, Yes, I have updated modified file with my comments. I have named STEP1.REQUEST, STEP1.RESPONSE, STEP2.REQUEST and STEP2.RESPONSE  for simplification in file. I have mentioned which values I need / will be set from STEP1.REQUEST to STEP2.RESPONSE. Just to ensure that the account numbers (dynamic values) must be written to file so that we have other transactions which can use them.

nmrao
Community Hero

Re: Need help in acheiving dynamic data load and filter back response from file

  1. what about the values in the STEP1.RESPONSE? I mean does not required any change based on request?
  2. Since both requests are related to different operations, that would(what you mentioned/requested) only possible if you persist the data from different requests (I mean data from STEP1.REQUEST) in Script Dispater. I remember, you were saying, "I need to update the response file". Now, looks I got why would you want to do that. Again, if you update it you would not be able to use it for next time you test the same operation.


One more thing is if you send 5 accounts data as part of STEP1.REQUEST, then you might be expecting 5 records in STEP2.RESPONSE and if that changes, it should reflect the same in response, right? So, it should be very generic.

So, I am wondering, are you doing just mocking or real application development?

Also, what if some one requests for x in STEP1.REQUEST and send Y in STEP2.REQUEST -- then your idea of updating the response of 2 will not work.

You mentioned that jdbc to be queried, that would be more appropriate to use within the script dispatchers of both the operations.
STEP1.REQUEST - in mock script - read the data from request, persist into database.

STEP2.REQUEST -- in mock script -- read the request data, query for required data from database and update the response.

This both of the requests do not have to be sequential as well.

Only thing is fixed response file may not work well here in this case(applicable for both the operations).

In earlier posts, pointed some links, "how to use jdbc connection, have you tried any"?

Which database are you using here?



Regards,
Rao.
Apoorva6
Frequent Contributor

Re: Need help in acheiving dynamic data load and filter back response from file

Hi Rao,

 

1) Yes, STEP1.RESPONSE can be fixed for any request.

2) Since I am using file, For second time, I use different initial file so that different account numbers which can be used again.

 

When I use 5 values in STEP1.REQUEST, I agree same should populate in STEP2.RESPONSE. But only 3 values I mentioned will be used back when we filter. So only 3 Values are enough.

 

I am only mocking here, not any dev work.

 

Since only X is set in global property, one and Only X cn be used in both Request.

 

I wanted to avoid jdbc here, as account numbers we get dynamically. Also I have updated the attached file again by adding STEP0.REQUEST and STEP0.RESPONSE.

FYI, we invoke STEP0.REQUEST and STEP2.REQUEST with same URL (same Operation). So I wanted to take the response from file and set account numbers back to file and then use again after filtering. Here is the summary of my flow again and remember that all 3 steps are not sequential.

 

1)Invoke STEP0.REQUEST with mode as SUBMITTEDORCORRECTED value along with ContractSolutionNumber set globally (ex SOL1234)

2) I need to get STEP0.RESPONSE present in file names SOL1234.xml

 

3) Above steps then invokes many transactions and we get account numbers that are invoked by STEP1.REQUEST. This request also has SOL1234 value

4)Get a fixed STEP1.RESPONSE back, so that our code assume it success and invokes further transactions.

 

5)Invoke STEP2.REQUEST with mode as LITE value along with globally set ContractSolutionNumber value with same URL of STEP0.REQUEST

6)Get Filtered STEP2.RESPONSE so that our code can use the same.

 

Note: I am also fine if its easy with 2 fixed responses. Say X.xml and Y.xml , where X and Y are set globally. X.xml is the initial file and after creating accounts write to Y.xml which can be used later.

 

Apoorva6
Frequent Contributor

Re: Need help in acheiving dynamic data load and filter back response from file

Hi All, Any update on this please ?

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors