WARNING: This page is about a different car, the 2003 Nissan Altima. However, it is still accessible from the selected car via links, so may be relevant.
Check continuity between terminals of the A/T device connector.
Fig 1: Detent Switch Condition Continuity Chart
Courtesy of NISSAN MOTOR CO., U.S.A.
Fig 2: Checking Continuity Between Terminals Of The A/T Device Connector (Detent Switch)