Wal-Mart is planning to test Tesla's electric tractor trailers and has already preordered 15, the retailer told CNBC on Friday.

Five of the preordered vehicles will be for Wal-Mart U.S., and 10 will be for Wal-Mart Canada, the company said.

"We have a long history of testing new technology – including alternative-fuel trucks – and we are excited to be among the first to pilot this new heavy-duty electric vehicle," the company said in a statement to CNBC.

"We believe we can learn how this technology performs within our supply chain, as well as how it could help us meet some of our long-term sustainability goals, such as lowering emissions."

Source: Tesla

Tesla Semi

The pilot is planned for the U.S. and Canada. Wal-Mart's fleet has about 6,000 trucks.

In an expansion from personal vehicles, Tesla CEO Elon Musk unveiled an electric semitractor-trailer Thursday that has a 500-mile range on a single charge and is electronically connected with a fleet's management system. The vehicle allows the driver to stand and puts the steering wheel in the center with a touchscreen panel on both sides of the driver. Musk said the truck is set to go into production in 2019, although the company has fallen far behind on its production schedule for the Model 3 mass market consumer vehicles.