Robot developers say they are close to a breakthrough—getting a machine to pick up a toy and put it in a box.

It is a simple task for a child, but for retailers it has been a big hurdle to automating one of the most labor-intensive aspects of e-commerce: grabbing items off shelves and packing them for shipping.

Several companies, including Saks Fifth Avenue owner Hudson’s Bay Co. and Chinese online-retail giant JD.com Inc., JD -0.30% have recently begun testing robotic “pickers” in their distribution centers. Some robotics companies say their machines can move gadgets, toys and consumer products 50% faster than human workers.

Retailers and logistics companies are counting on the new advances to help them keep pace with explosive growth in online sales and pressure to ship faster. U.S. e-commerce revenues hit $390 billion last year, nearly twice as much as in 2011, according to the U.S. Census Bureau. Sales are rising even faster in China, India and other developing countries.

That is propelling a global hiring spree to find people to process those orders. U.S. warehouses added 262,000 jobs over the past five years, with nearly 950,000 people working in the sector, according to the Labor Department. Labor shortages are becoming more common, particularly during the holiday rush, and wages are climbing.

Mechanical engineer Parker Heyl adjusts a robotic arm at RightHand Robotics’ test facility in Somerville, Mass. Photo: SIMON SIMARD FOR THE WALL STREET JOURNAL

Picking is the biggest labor cost in most e-commerce distribution centers, and among the least automated. Swapping in robots could cut the labor cost of fulfilling online orders by a fifth, said Marc Wulfraat, president of consulting firm MWPVL International Inc.

“When you’re talking about hundreds of millions of units, those numbers can be very significant,” he said. “It’s going to be a significant edge for whoever gets there first.”

Until recently, robots had to be trained to identify and grab each item, which is impractical in a distribution center that might stock an ever-changing array of millions of products.

Automation companies such as Kuka AG KU2 -3.10% , Dematic Corp. and Honeywell International Inc. unit Intelligrated, as well as startups like RightHand Robotics Inc. and IAM Robotics LLC are working on automating picking.

In RightHand Robotics’ Somerville, Mass., test facility, mechanical arms hunt around the clock through bins containing packages of baby wipes, jars of peanut butter and other products. Each attempt—successful or not—feeds into a database. The bigger that data set, the faster and more reliably the machines can pick, said Yaro Tenzer, the startup’s co-founder.

Hudson’s Bay is testing RightHand’s robots in a distribution center in Scarborough, Ontario.

“This thing could run 24 hours a day,” said Erik Caldwell, the retailer’s senior vice president of supply chain and digital operations, at a conference in May. “They don’t get sick; they don’t smoke.”

JD.com is developing its own picking robots, which it started testing in a Shanghai distribution center in April. The company hopes to open a fully automated warehouse there by the end of next year, said Hui Cheng, head of JD.com’s robotics-research center in Silicon Valley.

Swisslog, a subsidiary of Kuka, sells picking robots that can be integrated into the company’s other warehouse automation systems or purchased separately. The company sold its first unit in the U.S., to a large retailer, earlier this year, said A.K. Schultz, Swisslog’s vice president for retail and e-commerce. Mr. Schultz declined to name the retailer.

Previous waves of warehouse automation didn’t lead to sudden mass layoffs, partly because order volumes have been growing so fast. And automated picking is still at least a year away from commercial use, robotics experts say. The main challenge lies in creating the enormous databases of 3D-rendered objects that robots need to determine the best way to grip new objects.

RightHand Robotics co-founders Leif Jentoft, left, and Yaro Tenzer Photo: for The Wall Street Journal

Some companies hope to speed development by making some research public. Amazon.com Inc. will hold its third annual automated picking competition at a robotics conference in Japan later this month. For the first time, entrants won’t know in advance all the items the robots will need to pick.

At the University of California, Berkeley, a team is simulating millions of attempts to pick 10,000 objects. Funded by Amazon, Siemens AG and others, the project is meant to build an open-source database for use in any automation system, said Ken Goldberg, the professor leading the project.

“With 10,000 objects, I’m surprised how well it did,” he said. “I would love to show it 100,000 examples and see how well it performs after that.”

Write to Brian Baskin at brian.baskin@wsj.com