Please post the Model, Type and Code for your engine. These will be stamped on the cooling air cowl.

Essentially your engine has a Magnetron electronic ignition module, mounted just in front of the flywheel under the cowl. A magnet attached to the flywheel generates electricity as it passes the magnetic yoke which is part of the Magnetron. The same magnet triggers the spark as it passes the trigger unit of the Magnetron.

The usual cause of no spark with a Magnetron ignition is that the kill wire is grounded when you are trying to start the mower. The purpose of the kill wire is to ground the trigger unit, to stop the engine. However if the insulation is worn through or the governor plate connection to the end of the kill wire is messed up, the ignition might be killed all the time, rather than only when the speed control is in the stop position.

I suggest you trace the black wire that is attached to the governor plate (where the engine-end of the speed control cable connects) and watch its end terminal get grounded in the stop position, but not be grounded in any other speed control position. If it is working properly, trace it back to the Magnetron checking for insulation damage. If there is none, disconnect the cable completely and secure it so that it cannot touch anything, and test for spark again. If there is still none, you will need to check the grounding of the Magnetron, the condition of the high tension wire from the Magnetron to the spark plug, and the size of the air gap between the Magnetron and the flywheel (which should be the thickness of a business card). If none of these is the problem, it appears you will need to replace the Magnetron. This is a fairly rare outcome, though - Magnetrons are very reliable.