At work we used to whack the starter with a hammer while somebody tried to crank it. Usually that got one more crank out of it. If it cranked, that told you the pronlem was in the starter. It can still be the starter if it doesn't crank. When the hammer didn't test didn't work, we did a "voltage drop test", this will find the problem. You just need a good voltmeter. This will tell you exactly where the problem is in the circuit, a cable, a switch, the starter, there are YouTube videos showing you how to do this. 99 times out of 100 it's the starter but on weird problems the voltage drop test will find where the resistance in the circuit is located.
One time I had a brand-new vehicle with an intermittent starting problem, sometimes it cranked other times nothing, like it didn't even have a battery in it. The voltage drop test found the problem. I put the meters leads on "both ends" of the starter cable and cranked it. It should have read "zero volts" while I was attempting to crank it, but it read 12v, that can't be or can it. It seems when they put the battery cable end on the cable they didn't strip off the insulation. Sometimes it made the connection and sometimes it didn't. A brand-new car with a brand-new cable. The voltage drop test was the only way I found it.