Starter problem

I have had this problem for 6 months or so. I have a 2004 Mazda B4000. It started when I was on the road. I tried to start and there was no power going to the starter. Everything else worked. So I jiggled the wire to the starter (solenoid actually) and it worked. I took it to a shop where I was and they put a new connector on it and it worked for a while. The mechanic said that he thought he remembered hearing that this problem was common with some year Ford Ranger, which is just like the Mazda B4000 pickup. When I got home I took it to a local shop and they put a lock washer on it and it worked fine for a couple of months. Then it was doing it once every 20-30 times I try to start it. Just a light touch will fix it every time. I have attached a piece of fishing line to the wire so that I can jiggle it without going under the truck.
I wrote an email to Mazda asking if this was a problem with the B4000 and they said see your local dealer. That was what I wanted to avoid.
Anyway, I needed an oil change and so I took in to the local Mazda dealer. I told the service guy when making the appointment about the problem. When I took it in however I told him to forget about looking at the starter problem. Not that I do not trust them.
So they do the oil change and I talk to the service guy and he said that the truck would not start when they wanted to drive it into the garage. I wish that he had told me because I would have showed them how to start it. Instead what the mechanic did was tap the starter and he got it to start. So, the service guy tells me I need a new starter. Well, somehow I doubt that. I had taken the fishing line off to get the oil change. I put it back on and it has started every time since then.
Should I just change the wire or is it the starter?

It’s not the starter because if you wiggle the wire the starter operates. There’s something wrong with the wire that goes to the solenoid. I’d first try replacing that wire as close the solenoid as possible to see if that fixes the problem. And don’t cheap out when making this repair. Use solder and heat-shrink.

Tester

Thanks for your response. I am pretty sure it is the wire too but I was just wondering if it could be that the post that the wire is attached to is loose. I doubt it. It happens so seldom that I will let it be for now.

FII, I just replaced the starter for the 2nd time on a 93 Ranger 6 cylinder since this vehicle was new. The end of the solenoid was actually broken loose on the last one. This is my grandmother-in-laws truck. She thought the battery went dead at first. Put in a new one and it started right up. Then is started doing it again. When I got under the vehicle I could turn the end of the solenoid with my hand. Could yours be doing the same thing and just moving the wire with a fishing line was actually moving the solenoid around?