Switzerland's sluggish form ahead of the World Cup continued Tuesday when it lost 1-0 to Costa Rica in a friendly in Sion.
Forward Winston Parks scored the winner in with a 57th-minute shot after a determined solo run through three defenders.
The Swiss mounted a flurry of late attacks but have lost all three friendly matches since clinching their place in South Africa last October, and scored just a single penalty in that span.
"It was important for morale to win the match," Swiss coach Ottmar Hitzfeld said. "With a little bit of luck we would have equalized."
Hitzfeld has one more scheduled warmup to change his side's fortunes, against world champion Italy in Geneva on Saturday.
Switzerland opens Group H play against tournament favourite Spain on June 16. It also faces Chile and Honduras.
Switzerland started sharply and Marco Padalino's rising third-minute shot was tipped to safety by goalkeeper Keylor Navas.
Costa Rica showed pace on the break, and the lively Parks was denied by right back Stephan Lichtsteiner's well-timed challenge.
Bryan Ruiz, Carlos Hernandez and Cristian Bolanos all went close to scoring in the second half before the visitors took a deserved lead.
In the 59th minute, Swiss captain Alex Frei tested Navas with a curling free kick that the 'keeper pushed away to his left.
Three minutes later, winger Padalino met a crossfield pass unmarked but flicked his shot high and wide.
In stoppage time, Frei's powerful shot was parried by Navas before substitute Eren Derdiyok poked the rebound wide of goal.
Goalkeeper Diego Benaglio had the final chance, shooting straight at Navas in a scramble following a corner.
Costa Rica, which led before losing 2-1 to France last week, plays a third World Cup team, Slovakia, in Bratislava on Saturday.
Switzerland: Diego Benaglio, Stephan Lichtsteiner, Philippe Senderos, Stephane Grichting (Steve von Bergen, 46), Reto Ziegler, Tranquillo Barnetta (Albert Bunjaku, 76), Gokhan Inler (Pirmin Schwegler, 61), Benjamin Huggel (Gelson Fernandes, 61), Marco Padalino (Xherdan Shaqiri, 64), Alex Frei, Blaise Nkufo (Eren Derdiyok, 64).
Costa Rica: Keylor Navas, Roy Myrie, Douglas Sequeira, Gonzalo Segares, Junior Diaz, Bryan Ruiz (Jose Mena, 90), Michael Barrantes (Fernando Paniagua, 84), Randall Azofeifa, Carlos Hernandez (David Guzman, 77), Cristian Bolanos, Winston Parks (Marco Urena, 81)