Stool tests can be done to look for evidence of:
Infection (e.g. salmonella, campylobacter)
Inflammation (Faecal Calprotectin test), such as Crohn’s Disease and colitis
Polyps and cancer (FIT/FOB test, which look for minute traces of blood in the stool).
It should be noted that a positive test does not always mean something is wrong, but this needs discussing with a specialist and further investigations are usually required.