A man has stolen a car while taking it for a test drive - after leaving his driver's licence details with the Sydney car yard, police say.

The man visited a car yard at Warwick Farm, in Sydney's south-west and asked to test drive a 2007 model Mitsubishi Lancer, police said.

He agreed to have his licence photocopied before he and a salesman left the dealership in the car shortly after 2pm yesterday, police said.

A short time later, the salesman stopped the vehicle and left the driver's seat so the man could take the wheel, police said.

Instead, the man locked the doors and jumped into the driver's seat, police said.