Election officials across the country have conducted hundreds of exercises to prepare for possible threats or disruptions at polling sites.