2005 Hyundai Tucson check engine light came back on

my dashboard warning lights( battery symbol and brake ) lite up,my gauge needles all start bouncing wildly and after several minutes drop to far left and quit registering movement ,car starts jerking i coast into gas station and have it towed. mechanic finds battery and alternator bad,replace both. leave garage 1/4 mile away check engine light and battery symbol lite back up.return to mechanic with check engine light lite in addition to the orginal two lites.168,000 miles. mechanic does 2 hour diagnoistic test cant determine cars problem,anyone experienced this problem ?

Do not go back to this mechanic.A few complaints about missing or worned spark plug wires insulation in these vehicule causing engine to misfire in rainy weather.