If the dishwasher's water flow doesn't automatically shut off, the float switch is faulty, the timer is stuck on "Fill," or the water inlet valve is stuck open. To test the float switch, you'll need an inexpensive volt-ohm meter (or multi-tester).
1) Unplug the dishwasher.
2) Reach into the cabinet, and lift the dome-shaped plastic float switch. If it doesn't lift, remove the plastic top from the stem, scrub the stem clean, and then replace the dome. If it moves up and down freely, go on to Step 3.
3) Note which wires are attached to the float switch's terminals, and, using small pieces of tape, label them for later reference.
4) Set the volt-ohm meter's dial to Rx100 and touch the two probes to the terminals. When you lift the float, the tester's needle should show an infinity reading, and, when you let the float drop, the needle should show 0.
If it doesn't, the switch is broken and will need replacement. Unscrew it from the tub, and replace it.