I am trying to find variable value in Array list but error popup displayed.
Groovy code :-
def testCase = messageExchange.modelItem.testCase;
def Created_BookingID = testCase.testSuite.project.getPropertyValue("Created_BookingID");
log.info Created_BookingID
import groovy.json.JsonSlurper
JsonSlurper jsonSlurper = new JsonSlurper()
String jsonString = context.expand('${ListAllRoomBookings#Response}')
Map convertedJSONMap = jsonSlurper.parseText(jsonString)
def RoomID
//If you have the nodes then fetch the first one only
if(convertedJSONMap."RoomBookings"){
RoomID = convertedJSONMap."RoomBookings"."BookingData"."BookingID"
log.info RoomID
}
//Find the created booking in list.
assert Created_BookingID.containsAll(RoomID)
Error :- No signature of method: java.lang.String.containsAll() is applicable for argument types: (java.util.ArrayList) values: [[148281, 148282, 148277]] Possible solutions: contains(java.lang.CharSequence), contains(java.lang.CharSequence), contains(java.lang.String), notifyAll()
Print Values in window :-
Wed Aug 02 17:17:22 IST 2017:INFO:148277
Wed Aug 02 17:17:22 IST 2017:INFO:[148281, 148282, 148277]