Error message "The column path must start with a row path expression"
Hi everyone,
For my comparison testcase I need to compare the results of 2 different files with each other. For the POC I'm using mock data in files. One is an excel file the other is a json fi...
Thanks for your answers! To answer to your questions:
"In regards to your use of the JSON datasource - I'm not a groovy scripter - but looking at the groovy and what youre trying to do wiht the JSON datasource - you're trying to grab specific json attributes from the 'result' variable of the groovyscript - right?"
I'm not quite sure what you mean saying "json attributes". Do you mean like nodes in the file? Then yes, I need for this testcase 2 specific nodes and its value. But my Groovy Script mearely loads the whole file to be able to read to. I thought that this could help with reading the file out as the Datasource>JSON wasn't reading the file at all, and Datasource>File is just reading the first 10 lines of the file giving me a not wanted result in json.
GroovyScript result = OK:
DataSource2 = NOK for different reasons:
I only can add 1 RowPath for 2 properties
I can't add a column expression for each column as it gives me that error message.
I even start to doubt if I need to add an expression on the Columns....
If I understood this correctly, the DataSource Row Path refers to a specific node in the file to be searched for. Here being "Denomination" with its value. But I also need to look for the cbe_number node and it's value. And that is what I'm not able to do.
The purpose is to read information from a 'golden file' that plays the role as DB(I know, that's sheeting and ugly but it's a way for the POC to work whilst we're waiting for the DB :-) ) Out of that information (that should actually start in DataSource) I'm asking to Property Transfer to read the first line of the file, take the properties that I've defined and put it in my request so I can send the request with those particular properties. If the request was send successfully, I want the response to be put in the Property Transfer-GetResponse with all the properties present from the response and that will save this answer in DataSink2 for later comparision. This step is then followed by a loop to start at line 2 of the first Property Transfer. Until all the lines are read. If this is done, all the responses will be saved in DataSink2 and are then ready to be compared with the response of my other request.
I don't know if I made myself understandable here....?
"As an aside = I understand using groovy shortcuts a lot - but is there a reason why you're not using say a file or directory datasource rather than the groovy to load in the file?"
I'm still green working with ReadyAPI and a colleage of mine presented me to work this way. Now, might you have a better way to compare to different responses in 2 different extensions, be my guest.... :-)
My posts are GETters by the way
"can you confirm what you're actually passing to the REST request step? are you passing the whole .json file's content or just a couple of parameters?"just a couple of parameters needed here: cbe_number and denomination as parameters in the Request step. Those parameters are defined on TestCase level as "tempNumber" and "tempName" in tab Custom Properties and are called upon in the REST Request as
${#TestCase#tempNumber}
The DataSink2 will stash the responses in and excel file.
If there's anything you want to know, please tell me.
I'm struggling a little - youve provided the project .xml file which is really helpful - but you didn't provide the spreadsheets which are the source of the data and we can't execute the steps to generate the responses.
Can you attach the spreadsheets to help visualise what you're doing as well as sample responses please?
You mention .json in your previous posts - but the first test case is a SOAP request, the second is REST - so I'm kindof not understanding why you mention using json as a datasource. Also you Property Transfer steps to get the data are all using XPATH not JSONPATH excepting the property transfer used to grab values from the REST response.
Do your datasource spreadsheet contain json files? If this is the case, why have you copied the .json files into a spreadsheet?
Apologies if I haven't been clear - I'm just a little confused!
Yaks! So sorry people! I've send the wrong file... :-( I'm so into different tickets and my job for the moment that I've missed.
Nastya_Khovrina and richie the project and the files to read out and to stash are added.
So the "Results Comparison.xlsx" should have the results of the 2 environments (2 Testcases) whereas I can compare the responses in the same sheet.
richieI remember now why I used a Groovy Script to read out the json file. If you add a DataSource object and you select JSON one is obliged to already have a response before you can use the "pick and select". But as I don't get responses for the moment, I wanted to mock this. ;-)