Perftester Posts: 2
2/6/2025
|
Hello folks,
I'm currently trying to script a journey in which I am selecting an appointment/booking from a view (in the Web browser) which shows the view of each weekday, with timeslots for each day. The timeslots which are available are highlighted and those which are not available cannot be clicked on. Anyhow in terms of the Response captured, there is a Compute Slot request (to which the response is given) that has the date and timeslots given each with a SCORE. Timeslots with a score of either 2, 3, 4 or 5 are valid for selection. I am struggling to create an Extractor that is able to use the Start & End time for the correct Score given (it works for some iterations but i'm unable to correctly extract the correct values consistently)
Example of Response:
"results":[{"date":"2025-02-12","slotOutputs":[{"start":"08:00:00","end":"12:30:00","score":0,"travelTimeIncrease":0,"costIncrease":0.0,"internalCostIncrease":0.0},{"start":"10:00:00","end":"14:00:00","score":5,"travelTimeIncrease":148,"costIncrease":0.0,"internalCostIncrease":0.0},{"start":"12:30:00","end":"16:30:00","score":5,"travelTimeIncrease":148,"costIncrease":0.0,"internalCostIncrease":0.0},{"start":"08:00:00","end":"16:30:00","score":5,"travelTimeIncrease":148,"costIncrease":0.0,"internalCostIncrease":0.0}]},{"date":"2025-02-13","slotOutputs":[{"start":"08:00:00","end":"12:30:00","score":1,"travelTimeIncrease":6880,"costIncrease":0.0,"internalCostIncrease":0.0,"newRoute":true},{"start":"10:00:00","end":"14:00:00","score":1,"travelTimeIncrease":6880,"costIncrease":0.0,"internalCostIncrease":0.0,"newRoute":true},{"start":"12:30:00","end":"16:30:00","score":1,"travelTimeIncrease":6880,"costIncrease":0.0,"internalCostIncrease":0.0,"newRoute":true},{"start":"08:00:00","end":"16:30:00","score":1,"travelTimeIncrease":6880,"costIncrease":0.0,"internalCostIncrease":0.0,"newRoute":true}]}
The BOLD are the slots which are valid as Booking options
For the above, i've got a Text Delimited extractor that has Text before = "start":"10:00:00","end":"14:00:00", Text After = "score":5, and then i am able to extract the Start and End time for the booking. However for each iteration, the scores given are not consistent.
Example 2 of Response:
"results":[{"date":"2025-02-13","slotOutputs":[{"start":"08:00:00","end":"12:30:00","score":4,"travelTimeIncrease":1256,"costIncrease":1.1164444444444446,"internalCostIncrease":1.1164444444444446},{"start":"10:00:00","end":"14:00:00","score":4,"travelTimeIncrease":1256,"costIncrease":1.1164444444444446,"internalCostIncrease":1.1164444444444446},{"start":"12:30:00","end":"16:30:00","score":4,"travelTimeIncrease":1256,"costIncrease":1.1164444444444446,"internalCostIncrease":1.1164444444444446},{"start":"08:00:00","end":"16:30:00","score":4,"travelTimeIncrease":1256,"costIncrease":1.1164444444444446,"internalCostIncrease":1.1164444444444446}]}
Given that for each iteration the Score which is valid may have a value of 2,3,4 or 5 (invalid options are scores of 0 and 1). With extrators i am struggling to find the most logical approach.
Any help and guidance here would be appreciated. Thanks
|