Cavani nipped between the centre backs to head home a fine cross into the box from the left by Diego Forlan and Stuani scored his second goal in two games in the 75th minute following his effort in Friday's 1-0 win over Northern Ireland. (Agencies)
"I wasn't too convinced by our attack in the first half, in the second the team looked more compact," Uruguay coach Oscar Tabarez told reporters.
"The 'Master' (Tabarez) asked me to work on the right wing and get into the box whenever I could ... I hope at the World Cup I can carry on like this," Stuani said.
Centre back Diego Godin returned to the side after missing the Northern Ireland match, completing a lineup that may well be repeated for Uruguay's World Cup opener against Costa Rica in Fortaleza on June 14.
Top striker Luis Suarez was again missing as he recovers from knee surgery and may only be fit for the second Group D match against England in Sao Paulo on June 19 at the earliest. Uruguay also face Italy in Natal on June 24.
"We have great hopes of (Suarez) playing at the World Cup. I wouldn't assure it will be in the first match but nor are we ruling that out," Tabarez said.
Uruguay struggled at first to generate chances against a tough Slovenian side who gave them a few scares on the break with Andraz Kirm and Rajko Rotman coming close to scoring.
When the 50,000 crowd at the packed Centenario, scene of Uruguay's victory over Argentina in the first World Cup final in 1930, became impatient, they chanted Suarez's name.
However, right back Maxi Pereira almost put Uruguay ahead when his shot skimmed the bar midway through the first half from a fine through-ball by Godin.
The Uruguayans' superior skill made the difference in the end and Stuani secured the win by tapping home the ball at a corner when it ran loose with goalkeeper Samir Handanovic under challenge from Cavani.
Cavani nipped between the centre backs to head home a fine cross into the box from the left by Diego Forlan and Stuani scored his second goal in two games in the 75th minute following his effort in Friday's 1-0 win over Northern Ireland.