That is seldom a defective solenoid, about 8 times out of 10 it is a flat battery or poor high current terminal connection at battery or solenoid. Second most common is a poor low current connection at solenoid or key switch. Defective solenoid is (in general) a distant third most common. On used ride-on mowers, messed up wiring is a very common problem, so if the battery is OK and so are the connections, check the voltage at the low current terminal (from the key switch) of the solenoid when you turn the key to start. If voltage is low there but high at the high current solenoid terminal, trace the wiring, and find out how much damage the previous tenant did.