The ground to the fill valve is daisy chained together with a lot of things like the heater. Look around under the washer and look for a burnt/loose connection.
If ok, you should pull front panel and find the timer terminal that supplies voltage to the fill valve. Sometimes the pin gets burnt or pulls out a little, just push it in with meter probe. I check with the washer running, but with the motor wires disconnected to avoid spray arm spray!! If ok probably a stuck float.
Here is one for the books: The blue wire that feeds the fill valve broke and burned through the insulation where the entire group of wires passes through a metal guide at the bottom of the door. Almost impossible to detect without my magnifier. Tomorrow, I’ll pick up some wire of the correct gauge, splice in a piece and re-do the protective layer of tape. Done !!!