Need help to iterate through array of JSON response in TOSCA - tosca

I just started working on TOSCA, I need one help with the technical issue which I am facing now.
I have an API which sends a array of objects and my test condition should validate a particular field in all objects in array.
In TOSCA when I scanned my API, I see an item attribute is created and that has all fields within it.As per the source I see that we can extract any data from the item either by making the item as "$index" or by setting the value as index==1(index value).
or like this
But I don't want to iterate like this as for each test data, the number of items may vary and I don't want to hard code the response by index.As it fails with a new data set as below
With one test data I got four records and in next iteration response has only three records and also data updated so the verification is failed.
Can someone help me to find out a solution to iterate / loop through all items at once(using some loops) and extract data into buffer.

Related

using multi choice and collection in blueprism

I have about 3 collections and i want to write into an excel and send them in mail separately, I tried to use multi choice to finalize one after the other but it doesn't work
any other idea how to do this?
I will put screen shots below for more illustration
It's likely not functioning the way you intended because each of the three Data Items you're attempting to compare to a blank string ("") aren't Text-typed - rather, they're Collections. Collections themselves can't be compared to strings (see: apples and oranges), but the data contained within them can.
What you're likely attempting to do is to compare the value within the current row of each of those collections - it's not clear what the field name is from your screenshot (the field name itself is cut off on the right edge) but your comparisons should look something like the following:
[No Amount.Politic]<>""
[Pending difference.Field]<>""
[Ready to print.Field]<>""

Blueprism - Extract data from a web page into a collection

I am new to blue prism. I have a scenario where I am giving input (passengers details for traveling) to a travel portal and based on the input its generating a booking reference number, total cost etc. Now I want to read all the outputs into a collection but the problem is data is not tabular (cant use Get Table in read component). Its just the details of travel which are populating into textboxes. Please find attached the screen shot to have more clarity on this.
How to achieve this? Any leads will be appreciated.
Based on the screenshot you've provided, this is part of the Blue Prism Advanced Consolidation Exercise ("BPTravel").
"Get Table" won't work on this data because it is not a table. As you've mentioned, the data is presented in a series of textboxes.
The way to tabularize this data would be to create a Collection in your Process and manually define each of the Field Names in the collection, then read each text field in individually to the correct column in the collection.
Read each text box data into data item. Create a named collection (i.e Collection with pre-defined column name). Loop through the collection.column_name(You will be getting column name as collection by using Utility - Collection Manipulation action and get the column names) and first add a row to collection and assign values to collection fields

UFT - Running a single test case in QTP but a part of the flow needs to be iterated multiple times

I am trying to automate a test scenario using UFT 14.0, where I am using excel to store my test data and using ADODB concept to fetch the test data.
I need to run a single flow from start to end, and in between, a part of the flow needs to be iterated with different sets of data.
Eg: I need to login to makemytrip.com, book a ticket for 10 person with their personal details and then log out. So login happens once, but booking the ticket needs to be iterated 10 times and with different set of data and then finally we logout. I have 2 sheets in test data , first sheet
has login details, the other sheet contains passengers details. How can it be achieved using excel multiple rows concept??
Thanks in Advance. :)
Running a single test flow in QTP but a part of the flow needs to be iterated multiple times
You can iterate the record set obtained from the query. For example :
For i=0 to objRecordset.recordcount -1
testData1= objRecordset.fields(Colname1)
testData2= objRecordset.fields(Colname2)
testData3= objRecordset.fields(Colname3)
'Perform required acitions
objRecordset.movenext
Next
Hope this helps.
Regards,
Sandeep Jaju

Spotfire: How to filter 'old' data from data functions running on a data link that appends 'new' data

My situation is this. I have a data-link that continually appends new snapshot data to a table, and upon the arrival of a new snapshot, it runs an R data function (script) which does some calculations with results that append to an output table. The R calculations are quite expensive and the input data is large, and more importantly, the snapshots are independent of each other, so there is no need to re-process previously received snapshots every time a new snapshot arrives.
I can't make a data function that takes it's own results as input (i.e. to filter by previously processed dates), and my other idea also throws up cyclic dependencies (creating a second data function to generate a second table with previously processed dates).
Has anyone experienced this issue, and could you please give me some ideas on safe ways to address it? I'm new to Spotfire (and dash-boarding generally).
I had the same situation - I got around this with a few steps:
Added a new filtering scheme just for data processing
Adding a calculated column to my output table which was just "X",
that I could filter out ie. filter out the entire output table
Added a relationship between my input table and output on a key column which excluded any filtered out columns
In my data function input parameters, selected to filter the input data by the data processing filtering scheme.
This meant every time my function runs it only runs off the unprocessed data.
I am current appending the data so that it adds on update not
replaces. This works fine when I open the file everyday and save it
however is not working with the scheduled updates in the web player-
it doesn't add a data function add rows action each time - still
looking for a way around this.... possibly an iron python script will
do the trick..

How to retrieve the sum of items from a sharepoint list

Is there any way to get the sum of items based on some filters from sharepoint list? I was trying to access the GetListItems method. But this returns all the items in the list. That makes the data heavy. My requirement is to get only the sum of items.
For example items created in a specific year. I am trying to populate a chart in flex from the sharepoint list. Accessing all the items and then calculating the sum in flex will not work always where the list contains more items.
Use the viewFields parameter of GetListItems to only return a single (small) field like ID. It is still data heavy but better than returning all the fields from the list.
There is a rowLimit parameter too that you can use to return all the list items instead of only a block at a time.
Info on the GetListItems method with code snippets at MS:
http://msdn.microsoft.com/en-us/library/lists.lists.getlistitems(v=office.12).aspx

Resources