Under sodden skies, Pennsylvania voters yesterday chose from 11 contenders the Republican and Democratic nominees to succeed Gov. Milton J. Shapp.

Former prosecutors running as self-styled "outsiders" had been favored in both races, but the prospects of a small turnout - discouraged by the chill rain - improved the chances for the candidates with more organization support.

In the Democratic race, that figured to aid Lt. Gov. Ernest P. Kline, 48, who had the backing of the Shapp administration, state employes, teachers and much of organized labor.

Shapp was barred by the state constitution from seeking a third term.

Kline had been consigned to a probably third-place finish in most pre-election polls, because the Shapp administration has been tarnished by scandals which have led to the indictment of more than 60 state officials.

The cofavorites for the Democratic nomination were former Pittsburgh mayor Pete Flaherty, 53, and former state auditor Robert P. Casey, 46, both longtime factional foes of Shapp.

Flaherty campaigned on his crednetials as a budget-cutting mayor and the deputy U.S. attorney general in the first year of the Carter administration. Casey, who had the nucleus of a statewide organization developed in two losing primary campaigns against Shapp, said he had "blown the whistle" on waste and fraud in Harrisburg, the state capital, as state auditor.

But the Democratic contest was overshadowed by the Republican contest, featuring three former prosecutors and a state legislator who boasted one of the most extensive organizations ever assembled for a primary.

The legislator, Robert J. Butera, 43, former minority leader of the state house of representatives, was a longshot in the betting, but - like Kline - was expected to be helped by a light turnout.

The three GOP prosecutors were Richard L. Thornburgh, 45, former U.S. attorney in Pittsburgh and assistant U.S. attorney general in the Ford administration; David W. Marston, 35, who was U.S. attorney in Philadelphia for a year before his controversial removal by the Carter administration, and Arien Specter, 48, the former Philadelphia district attorney.

All three insisted that they were uniquely qualified to cope with the corruption, which has become the dominant issue in the state.

Beyond the immediate stakes, the GOP primary was a test of strength between the state's two Republican senators, Richard S. Schweiker and H. John Heinz III.

Heinz and his family backed fellow-Pittsburgh Thornburgh, while Schweiker lent his support to Marston, a former member of his Senate staff. Specter, who lost a bitter 1976 Senate primary to Heinz, found his financial and organizational base in the Philadelphia and Delaware County Republican organizations.

Marston disclosed the day before the primary that he had received a $3,000 contribution from the Citizens for the Republic, the group headed by former California governor Ronald Reagan. In 1976, Reagan picked Schweiker as his intended vice presidential running mate in an unsuccessful effort to pry loose enough delegates to defeat President Ford at the Kansas City convention. Critics had charged Schweiker with using Marston's candidacy in an effort to gain control of the 1980 Pennsylvania convention delegation.

Thornburgh, who was accused of playing the same stalking-horse role for Heinz' 1980 ambitions, drew criticism. Monday from his rivals for failing to keep a "gentleman's agreement" with the Republican state committee for a full disclosure of campaign finances before primary day.

Thornburgh said his staff did not have time to compile the report on $350,000 of contributions, and Specter said he was "outraged that he is trying to sneak by without disclosing."

State law requires such reports 10 days after the primary.

In a spotlighted congressional race, Chairman Robert N.C. (D) Service House Post Office and Civil Service Committee was challenged in his Philadelphia district by the Rev. William H. Gray III, who came within 339 votes of victory two years ago.

Rep. Joshua Eilberg (D), whose telephone call to President Carter urging Marston's ouster as U.S. attorney became a matter of controversy when it was learned that Eilberg was under investigation, also had a primary challenge from three opponents. Eilberg was favored in pre-primary betting.

Rep. Daniel J. Flood )D) of WilkesBarre, another target of federal investigation, was also favored to win renomination.