Leakage detection using foam