My car cranks , but does not turn over or start, I was told that CPS is faulty, on 1999 Mercedes-Benz E320

The problem started few months back , but if i left the car for an hour or so, it would start and it will be fine for 3-4 weeks and it do it again, now the car refuses to turnover or start at all.Can anyone tell me where is the crankshaft sensor situated in my car Mercedes E320 Elegance 6 it infront of engine or on the back of it? photos will be much appreciated.

This might sound a little funny; however, I've had this problem in the past with my e 320 1994.Go to your car, and lock the trunk, which should lock all doors. Still while trunk is locked, unlock the door, then lock, and unlock once more, then try. One time I did all this, but while after locking doors and trunk, I then took off my battery leads and put them back on, maybe this reset somethin to it's default seeting, I don't know. Good luck.