Diagnosis of an E. coli infection is typically confirmed through laboratory testing of stool samples. These tests can identify the presence of specific strains and toxins produced by the bacteria. Rapid detection methods, including polymerase chain reaction (PCR), are increasingly used to identify pathogenic strains more quickly and accurately.