Rockville lawyer Daniel J. Cassidy, a Democratic candidate waging an aggressive campaign for Montgomery County state's attorney, accused incumbent Andrew Sonner yesterday of taking an excessive number of trips at taxpayers' expense.

Cassidy, in a press release entitled "Flights of Fancy," refers to Sonner as "this happy wanderer, globetrotting the world at government's expense." Cassidy lists 62 trips Sonner has taken in the last four years, including ones to Napa Valley, Calif.; Sun Valley, Idaho; a fact-finding trip to Israel to study the judicial system there, and Sonner's 1976 trip to Spain on which he sought unsuccessfully to extradite a criminal defendant wanted here.

Sonner, seeking his fourth four-year term as the county prosecutor, was in Boston yesterday at a meeting of the National District Attorneys Association, of which he is vice president. "It's kind of in keeping with his Cassidy's method of campaigning to make loose and unjustified charges," Sonner said in a telephone interview. "He did it in his last campaign and people yawned about it then."

Sonner easily survived Cassidy's last Democratic primary challenge in l978 after a bitter campaign in which the young challenger criticized the incumbent's detached style of administering the prosecutor's office and his personality, often described as abrasive.

Cassidy is once again trying to make Sonner's style and personality an issue.

Unlike other chief prosecutors in the area, Sonner does not personally prosecute cases. He maintains that his role should be administrative, leaving his assistants to prosecute while he sets policy. Cassidy has promised to take a more direct role trying cases, saying "the first thing a state's attorney has to do is prosecute the criminals."

Sonner said he must travel frequently as an officer of the national prosecutor's group, which discusses issues of concern to local district attorneys. His travel vouchers filed with the county's office of accounting also show that Sonner travels regularly to various bar association meetings, and to meet with legislators in Annapolis.

The documents also show Sonner has taken several trips for "affirmative action recruiting," to Boston in April, and to Stanford law school in California during the Napa trip.

Sonner, as director of the state's attorney's office, does not need approval for his travels. During the last fiscal year, his office spent $7,700 for out-of-town travel. This fiscal year the office was budgeted $11,410, according to Charles Maier, public information officer.