President Carter has entered a time of testing in his drive to arrange comprehensive peace agreement in the Middle East. The difficulties and doubts have risen sharply, and optimism has dwindled in the White House and elsewhere.

The unexpected coming to power of Israel's opposition Likud Party and its veteran leader, Menachem Begin, has posed a fundamental challenge to Carter's plan for a Middle East package deal because Begin rejects some of its main elements.

When Carter sought reassert his proposal two weeks ago in a public retort to Begin issued by the State Department, leaders of the American Jewish community reacted strongly in support of Israel. Forced onto the defensive, Carter summoned 53 Jewish leaders to the White House last Wednesday to reiterate his commitment to Israel's security and restate his peace plans in language more palatable to the Jewish state than his earlier public statements.

Arab leadership remained passive in the early stages of the Carter-Begin maneuvering, taking the position that it is up to the U.S. leader to force Israeli concessions. But as Carter began to swerve from an open confrontation with Israel, there have been signs of stiffening in the Arab world and some indications that the Arab bargaining price is going up.

In public statements and background talks with reporters, Carter remains committed to the concept of an overall peace agreement which he has espoused since taking office. However, senior White House aides believe it is unlikely that he will be able to reach agreement with Begin on the contested aspects of the peace plan during their White House meetings later this month. White House and State Department officials in Washington - and Israeli officials in Jerasalem - have begun searching for alternative ways to keep the hopes for peace alive if and when the comprehensive plan is abandoned.

Reports from Israel say Foreign Minister Moshe Dayan is preparing a series of counterproposals for Begin to submit to Carter in an effort to show that Israel is not entirely negative about the drive for peace. At the same time Israel is preparing a public relations offensive - including a U.S. speaking tour by former Foreign Minister Abba Eban - aimed at convincing the American public that Israel is not to blame for the Middle East diplomatic difficulties.

Despite mounting problems on everyside, there is still a surprising confidence among Carter administration foreign policy operatives that a Geneva conference on Middle East peace can be convened before the year is out. But there is not much confidence, even in the most optimistic guesses about the future, that such a Geneva meeting with substantive progress arranged in advance, isn't heard much anymore.

Failure or downgrading of the drive for a comprehensive settlement would be a serious blow to Carter's foreign policy. Beginning within a few days of his inauguration, the new President emphasized his belief that 1977 is the crucial year for movement toward an overall Middle East agreement. He backed up his resolve by sending Secretary of State Cyrus R. Vance to the region and bringing Israeli and Arab leaders to the White House, one by one, for highly visible conferences about the requirements and prospects of peace.

Carter's deep and open involvement has committed the prestige of the U.S. government to a package deal and raised expectations in the Arab world. The same circumstances generated worry in Jerusalem even before Begin's rise to power - and grave concern about a confrontation once Begin won the Israeli election in mid-May.

By early June the complaints from American Jews are strong enough to be heard clearly in the White House, prompting chief political aide Hamilton Jordan to take a personal hand in Mideast policy for the first time. On June 2, in response to a White House request, representatives of the American Israel Public Affairs Committee (a leading pro-Israeli lobby) submitted an informal list of 21 complaints about the Carter administration's Israel policy.

Six of the complaints dealt with U.S. arms sale policies but 11 dealt with Middle East diplomacy. Examples:

"Carter leaks on nonproductivity of meeting with [then Israeli Prime Minister] Rabin," Carter remarked on 'Palestinian homeland' at Clinton [Mass.] towm meeting," Exicessive laudation by Carter, of [Egyptian president] Sadat, [Jordanian King Hussein,] [Saudi Crown Prince] Fand and particularly [Syrian President] Assad" and "private statements by Carter that the Arab leaders all desire peace and that Israel is less forthcoming."

The domestic political difficulties multiplied after the State Department on June 27 issued a White House-initiated warning to Israel. The U.S. statement objected to remarks to Begin and Dayan refusing to consider the return to the Arabs of the Israeli-occupied West Bank and Gaza Dtrip. Such a return of territory is a fundamental part of the comprehensive settlement that Carter proposes.

According to participants in last Wednesday's White House meeting with the U.S. Jewish leaders, Carter spoke of some Israeli return of some Arab territory in the context of a final peace, giving this far less emphasis and impact than his earlier public call for nearly complete return of captured Arab lands. He also made clearer than ever that he does not favor establishing an independeant Palestinian state, calling such a creation a potential threat to peace, and reportedly he said that several Arab leaders agree privately that a Palestinian entity must be closely linked to Jordan.

With reporters present for picture-taking at the beginning of the meeting, Carter defined the substance of an Arab-Israeli peace as "full diplomatic relations, an exchange of ambassadors, open communication and travel across national borders, trade, commerce, tourism cultural exchanges and free passage of transportation."

He noted that this would be difficult for the Arabs to accept and, after reporters had left, he challenged Israel and American Jews to place Arabs on the defensive by emphasizing the sweeping nature of the peace requirement he had just announced.

In an emotional defense of his "unswerving commitment" to Israel. Carter reportedly called it "part of our national consciousness, part of my personal religious views, part of my responsibility as President and part of the totality of American life." He also criticized former Secretary of State Henry A. Kissinger and President Ford for withholding arms shipments from Israel as a form of pressure, and pledged "on my word as a man" that he would never do so.

A recent report in The Jerusalem Post said Israel's military stockpile now is large enough to sustain a cut-off of American supplies from 12 to 18 months without harmful effects. And Vance reported to the Jewish leaders Wednesday that another $3 billion in arms for Israel is in the U.S. pipeline. Most of this is paid for by U.S. grants of loans.

Arab leaders have had remarkably little to say about Begin's election and the onset of intensive U.S.-Israeli maneuvering. In mid-June, however, Syrian Danish journalists that he is unwilling to grant diplomatic recognition, or commercial or economic co-operation to Israel in a peace agreement. Last weekend Egyptian President Anwar Sadat was quoted as telling a Beirut magazine that even Jesus Christ and the Prophet Mohammed would be unable to convince Arabs to open their borders with Israel after 29 years of bitterness and war.

Sadat was also quoted as saying that "America is 100 per cent responsible for Israel's existence and survival. So America also is 100 per cent responsible for peace in the Mideast." He did not say what would happen if the drive for peace should fall apart.