Engine Dying, Not the Alternator, Ideas?

I have a 2003 GMC Envoy, 2WD, 120K miles. Last week the car lost all power while I was pulling into a parking lot. It started right back up. My husband tested the alternator by disconnecting the battery or part of the battery and everything appeared fine. I drove it for about a week and had no more issues. Today while waiting in traffic it started powering down and then up again over and over. I turned off the car and restarted and made it to work with no more issues. There is a new battery in the car. Any ideas what the issue might be and anything we can try before we bring it into the mechanic?

Fuel Pump?

THAT IS NOT HOW YOU TEST AN ALTERNATOR! by un hooking the battery with the car running you can fry some expenive electronics also you remove the battery from the charging system it will shut the car off becouse the alt. needs a refernce voltage to work.take it to an Autozone or an Advance auto they can test it on the car or of the car .

ps you can still have a bad alt.

Along with what Mark said, also check the connections from the battery to the frame, from the frame to the engine and from the battery to the alternator.

If you mean you lost electrical power then the connection to the battery, power panel under the hood, and ignition switch all can be suspects for the trouble.

Has the throttle body ever been removed and cleaned? Do the RPM’s cycle up and down only/worse when the heater, AC, or defogger is ON? The 4.2 I6 has no PCV valve. The t-body gets coated with a goo (technical term) and sticks. Removing the t-body and cleaning both sides is often the cure. Use throttle body safe cleaner and disconnect the battery while cleaning.
This site has a great explanation: http://gmtnation.com/f25/why-you-may-need-clean-4-2l-i6-throttle-body-799/

“Today while waiting in traffic it started powering down and then up again over and over.”

That’s a symptom typical of a vacuum leak or a failing fuel pump. A bad IAC motor could also be the cause.

Start by stopping at a parts store and having them check for stored fault codes. You may have some. Post the codes here. Note that a vacuum leak in the induction system and even a failing fuel pump may not cause a code to be stored, but a bad IAC should.

Post the codes.