I did a search on google for ya. This came straight off the Briggs and Stratton Page
The anti-after fire solenoid is a device that shuts OFF the fuel at the carburetor to prevent the engine from receiving fuel after the ignition switch is shut OFF. Anti-afterfire solenoids are installed on select engines that have a battery-powered electrical system. To test the anti-afterfire solenoid, connect one pole of a 9 V battery to the spade terminal and the other pole to the solenoid case. A sharp distinct movement should be seen. If not, the solenoid is defective. Care should be taken to prevent damage caused by over extension of the plunger during removal and installation.
When testing some anti-afterfire solenoids, the plunger must be touched or nudged to initiate movement. When installed in the carburetor, the anti-afterfire solenoid plunger contacts the orifice in the jet before reaching the maximum extended position. When removed from the carburetor, the plunger is in maximum extended position. A nudge may be required because power from the 9 V battery may not be sufficient power to retract the plunger from the maximum extended position.
This solenoid must be connected to 12 volts while the engine is running and no voltage when the key switch is turned off. It can come 2 ways: The old style used the solenoid case as the ground, which automatically grounded the solenoid when it was screwed into the carburetor and the black wire went to the key switch. Presently, there are 2 wires, the gray wire goes to the key switch and the black wire goes to ground.