To test this sensor, you will need the use of an oscilloscope.
Visually check the connector, making sure it is attached properly and all of the terminals are straight, tight and free of corrosion.
The output voltage of a proper operating camshaft or crankshaft position sensor switches from high (5.0 volts) to low (0.3 volts). By connecting an oscilloscope to the sensor output circuit, you can view the square wave pattern produced by the voltage swing.
Compare the scope pattern readings and results and repair or replace sensor as necessary.