Dishwasher trips main circuit breaker

Whirlpool dishwasher trips the main circuit breaker during cycle. Runs through the rinse cycle (no heat) fine but will trip the breaker during a regular cycle. I’ve removed the heater element and although It is somewhat pitted due to wear, I’ve got continuity through the element. Don’t mind replacing it but not sure I’ve isolated the problem. Any suggestions? Is it likely the heater element is the problem despite having continuity?

Add’l info. The dishwasher stops after water fills and begins washing. When it stops, there is water in the bottom and no power to the washer. The inside is definately warm. After re-setting breaker, power is back on (lights on). If I restart the cycle it will run for a few minutes and the breaker trips again. I can drain after resetting. I’m wondering if it is possible that the the element could be shorting after heating up.