If your dishwasher motor only has two or three wires, it is a single-direction motor, which means the dishwasher has a drain valve. If the motor has four wires, it is a reversing motor and the the machine doesn’t have a drain valve.
So, provided you have a drain valve to test, here are the basics, thanks to this article from acmehowto.com:
First, you need to follow all safety procedures. For example, make sure the machine is unplugged.
Remove the lower panel underneath the dishwasher door (it’s usually held in place by a couple of screws). Most of the time, the drain valve will be close to the motor. Simply locate the motor and look for a hose coming out of the motor. The hose should lead to the drain valve. The valve is essentially two parts: the gate arm and the solenoid. The gate arm should move up and down smoothly. Check the springs on the gate arm–if they’re damaged in any way, replace them.
The solenoid will have two wires connected to it. Check the terminals and the wire connections for corrosion. Replace any corroded part. Use a multitester to test the solenoid for resistance. With the multitester on the X1 setting, touch the probes to each terminal. The solenoid should read about 40 ohms. If there is no reading or if it’s nowhere close to 40 ohms, replace the solenoid.