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."