@Diya.3rif Need to use reources and set maximum succes number (recomended).
If you work in one thread and use loop(not recomended), you can unset Reuse recources.
Create a variable called "counter". Than use "is element exist" to check if element exist and update "counter" variable whenever element is missing. Check counter variable in the loop, and fail thread if "counter" hit 3