Dishwasher lights flashing, intermittently no power, stops midcycle

Recently my dishwasher has been stopping midcycle. There is some water left in the bottom but it will drain if I push the cancel button and close it. At first it was only stopping midcycle and the high temp and heat dry lights would be flashing flashing.
Now there are times that no buttons will work as if there is no power going to it, regardless of if it was running a cycle or not. After waiting sometime the lights will be flashing and we can restart the cycle but it never makes it all the way through. Sometimes the lights will be flashing even after no one has used it and the door is just closed and its off.
We have checked most of the parts for continuity and they all registered. There is no clog. The breaker is never tripped when this happens and we have tried turning off power to it and turning it back on. Nothing seems to work.
Would replacing the door switch or latch assembly make sense or the control board?
Thanks