Voltage drop testing is usually the most accurate way to test for corrosion, or bad cables, connections for a given segment of a circuit.
Sometimes there not easy to do because of physical location of either end of wire/cable, such as the positive battery cable down to starter.
In essence you put a voltmeter leads (on low scale) across the wire. Red lead at battery terminal/post the Black lead at the starter solenoid stud/terminal.
Now while (or attempting to) crank the vehicle, watch the voltage reading on the voltmeter. If there's any more than .2 volts (200 millivolts) showing up, you have a poor connection or there too much resistance/corrosion in the cable.
Electricity will take the path of least resistance, any voltage read on the volt meter is volts being lost across that wire/cable because it's easier to flow through the meter. If it's enough, like maybe 1-2 volts, on an already weak battery (12v or less) it might not engage solenoid or spin starter. At rest, fully charged battery without surface charge should be at about 12.6v +/- approx .1
All of the above assumes the problem is not in that (usually) purple wire that
spongbob is talking about.
Ergo, you have to confirm that when the problem actually happens.
So, get yourself some length of wire and hook up a little light bulb on it. Like an old turn signal bulb and socket. Connect one side to ground, the other side over to the S (purple wire) terminal on your starter. Run that wire and bulb carefully inside car where you can visually see it.
You've effectively added a "test light" to your starter control circuit and now every time to attempt to crank the starter that bulb should light up telling you that purple wire from IGN switch through firewall and down to starter solenoid is good.
If you go to crank starter, and it doesn't crank but the light is on when you turn key then your problem is the starter, solenoid, battery condition or one of cables/connections.
If you go to crank and no crank, but light doesn't light up either then you need to trace and find the open, problem in that purple wire.
Hope this all makes sense and helps.