A system and method for testing printheads is disclosed. The system comprises an optical sensor mounted on a movable carriage. The optical sensor is moved past a nozzle to be tested on the printhead while the nozzle ejects ink. The output signal of the optical sensor can be used to determine when the trajectory of the ejected ink is improper.