Nissan Motor Co. is testing self-driving cars at one of its plants in Japan that can tow vehicles on a trailer to the wharf for loading on transport ships.

The Japanese automaker thinks the technology will, in the long run, save costs and boost efficiency. The tests also can add to knowledge needed to take such autonomous driving onto public roads.

Nissan executive Haruhiko Yoshimura said the automaker hoped to use the technology throughout the Oppama plant by 2019, and in overseas plants in the future.

During a demonstration Monday, a Leaf car with no one inside scooted along the road, pulling a trailer with three other Leafs on it, stopped properly for other vehicles, and then veered into a parking lot.

But one vehicle ran into trouble, refused to move and was not able to take part in the demonstration.

Kazuhiro Doi, a Nissan vice president, acknowledged such glitches showed a challenge unique to the technology.

"If there are drivers, they can take action," he said. "Mechanical operations are all there is in a driverless car."

Nissan, which makes the March subcompact, Infiniti luxury models and the Leaf electric car, now has just two of the self-driving Leaf cars.

For all the vehicles produced at the Oppama plant to be towed in a driverless way, five more such vehicles are needed, according to Nissan.

People still had to get inside each of the towed vehicles to drive them to the proper wharf, but Nissan hopes that as self-driving technology advances cars will drive themselves into the ships, up the plank on their own.

Driverless cars are still not allowed on regular public roads in Japan, although major automakers are all working on such technology. Driverless driving is legal within private facilities like Nissan's.

In commercial products available in Japan, the vehicles, with some variation of autonomous driving, can stop on their own before a crash or stay inside the lane on their own for highway driving, although all must have drivers.

Nissan, allied with Renault SA of France, has been carrying out tests with driverless towing since last year.