Check the battery is getting fully charged, then next time it does it, try just bridging the battery to solenoid wire to the switch side from the ignition switch, if it then turns over it's a dicky connection.
It would not hurt in any event to clean all the wires, most particularly the earth wires on the engine.
tabetha