As a rule of thumb DONT EVER DISCONNECT A BATTERY from a running machine. Two reasons why:
1. When a person does that it can create a syrge that is strong enough to destroy an alternator. It was an old trick that worked with the generators of yesteryear.
2. Any spark at the right moment, with the right amount of escaping gas can cause a battery to BLOW UP in a person's face. A very ulgy, possibly blinding and scarring situation.
I hear of hundreds of people that try this every year, especially mechanics. PLEASE PLEASE don't.
Here is the proper way to check a battery and charging system.
1. Visually check for the obvious, broken or disconnected wire to the battery and alternator.
2. With engine off, check belt tension. You should not be able to turn the alternator's pulley. Do not overtighten the belt because that will lead to bearing failure in the alternator.
3. Remove the battery, charge the same battery on a slow or trickle charge, for at least 8 hours.
4. Same battery still, have it "load tested" at your local parts store or repair shop. Literally a 10 second job.
5. If battery checks out OK, reinstall and check alternator's output voltage off idle. Should be at least 13 - 15 Volts. (Most usually do at idle)
6. If all checks OK, then the diode in the alternator, sending the signal to the "dummy lamp" is on its way out. (Hence the word idiot light - still charging but says no at the same time)
A guess would be that the battery is bad. A bad battery will cause an alternator to show a lower charge voltage and even cause an alternator to fail eventually.
I hope this helps.