Prime Minister Indira Gandhi's fractious Congress-I Party--and her own formidable personal popularity--will be put to a major test Wednesday when more than 50 million voters go to the polls in three states to elect state assembly candidates in an important by-election.

While the balloting will focus nominally on candidates for 576 legislative positions in Andhra Pradesh and Karnataka in south India and Tripura in the far northeast, the elections could determine whether Gandhi's charismatic and almost matriarchal hold on much of the electorate will remain the dominant feature of Indian politics.

The election is particularly important to Gandhi in the two southern states because it will determine whether she is losing her grip on that vast portion of India, which could lead to a chain reaction in other states before the national elections two years hence.

Apparently mindful of the stakes, the prime minister recently completed an unprecedented campaign effort in Andhra Pradesh and Karnataka, barnstorming the two states by helicopter for 16 days and even putting on the line the political capital of her son and heir-apparent, Rajiv, 38, who joined an entourage of six chief ministers (governors) and 25 ministerial-level officials from the capital.

Andhra Pradesh, with 31 million voters, is the prime minister's base constituency, and Karnataka is where she first started her comeback trail in 1980. In 1978, at the nadir of her political career, the Congress-I (for Indira) party won almost 40 percent of Andhra, gaining 175 of 294 assembly seats, and in Karnataka it took 43 percent of the vote. In the 1980 parliamentary elections, Gandhi's party swept both states.

But the party's image there has plummeted during the last two years, partly because of increasing unrest over corruption and administrative ineptness, but also because of the heavy-handed control of state politics by the central leadership in New Delhi.

As elsewhere in the country, Congress-I in Andhra Pradesh and Karnataka is torn by dissension and rivalries between long-time party loyalists and recent defectors to its ranks who have been rewarded with coveted places of power. Gandhi's popularity, as a result, has suffered because she is perceived by many erstwhile supporters as having reduced the party's grass-roots political organization to a narrow, personal cult.

Compounding her problems in Andhra Pradesh is the emergence of the Telegu Desam Party, founded by Nandamuri T. Rama Rao, a portly 60-year-old movie idol who has appealed to strong regional feelings and pride in the dominant Telegu language.

Known popularly as "NTR," Rama Rao has portrayed deities in more than 300 Telegu films, often cast as the last popular avatar to emerge before chaos overtakes the earth, as written in Hindu scriptures.

"That is why the people put their hopes on me. I've portrayed lots of divine characters, so they believe I will do what I promise . . . ," Rama Rao told India Today magazine last week. Life-size cardboard cutouts of the actor dressed as Lord Krishna and bedecked with garlands line his campaign routes, and almost everywhere he goes his movie set van is followed by thousands of fans of Indian films, the only affordable entertainment available to the majority of the population.

Telegu Desam, however, is hampered by a lack of sophisticated political organization and the image of pursuing a confrontationist policy with the central government. Gandhi has called Rama Rao a "political joke"--to which he retorted, in a reference to the prime minister's son, that if an obscure airline pilot can be thrust into a position of national power, so can a movie actor.

Although personalities and not substantive issues have dominated the campaign, Rama Rao's themes have included unabated poverty, corruption, Telegu honor and neglect of the south by the central government. To counter Gandhi's appeal to the casteless untouchables, he has put 40 untouchables on his ticket.

In Karnataka, Congress-I dissension and resentment over consolidation of power in New Delhi are expected to be the major factors in the outcome of contests between Gandhi's party, a Janata Party-led four-party combination and the Bharatiya Janata Party.

While Congress-I is expected to retain its control of Karnataka, political observers there have predicted a reduced margin in the assembly, and have noted that regardless of the outcome, Gandhi will no longer be able to take the state's 20 million voters for granted.

In Tripura, which attained statehood in 1972, the contest is mainly between the ruling four-party leftist coalition led by the Communist Party of India (Marxist), and the alliance between Congress-I and the Tripura Upajati Juba Samiti, an extremist regional party.

Law and order is the primary issue among the 1 million voters, and security has been tightened against ambushes by armed tribal extremists.

Apart from providing one of the last substantial tests of Congress-I party's popularity before the general election, possibly influencing Gandhi's decision on the date of the balloting, Wednesday's elections have international implications as well.

The prime minister is widely regarded as the only leader of a major Third World country with a solid political base at home, and any demonstrable erosion of that base would almost certainly be an embarrassment so close to the scheduled March 7 summit of the Nonaligned Movement, of which India is a founding member.