You cannot. It must be taken out of the circuit and then tested on its own.
That's not 100% true because, if it has wires at its ends, you can cut through one wire with an appropriate tool and then test the capacitor "out of circuit". If the capacitor is ok you can then re-join the two cut wire ends by applying a blob of solder carefully. (But, to avoid damaging the capacitor, use a suitable heat sink to shield the body of the capacitor from the heat of the soldering iron.)
With direct current a capacitor also works like a special type of resistance. Whilst being charged up, it will show low resistance. As it slowly (or quickly) charges, the resistance will grow larger and larger. Whenever I repair circuitry and I have doubts about a capacitor (in the uF area) I simply use my multimeter on its Ohms setting. If a capacitor has shorted, then the result will be 0 Ohm. If the capacitor is working, or partially working, the resistance will gradually increase until it is out of range of the multimeter.
Use an ohm-meter first to test the on-board capacitor and then use it to test a similar capacitor off-board, to see if the results sort of match up.
Most often they will not match completely as on-board you also measure the effect of all other components connected into circuit with the capacitor. It might point you in the right direction though.
On a separate thought, if you really cannot remove it, or disconnect one of its connections, then why test it at all? If it really can't be removed to replace it, then it makes no sense to test it!
A capacitor can be tested using multimeter without removing it from circuit. but in order to check it, its polarities should be noted and then keep the positive terminal of multimeter on positive of capacitor and negative terminal on negative. It is vital to note that the readings will be affected by the remainder of the circuit. To test for capacitor function in circuit demands a good understanding of the circuit operation.
Of course there are ways to test capacitors, both in circuit and out. While a truly accurate test involved taking the cap out of circuit, a basic test can certainly be done in circuit.
Out of circuit, one can either connect to a VM, or better yet, an oscilloscope, and measure the time for voltage to decay to zero across the capacitor. This time should equal the time given by the equation for the time constant, and is dependant on the values associated with that particular capacitor.
For RC circuits, this equation equals:
Ï„ = R Ã— C. It is the time required to charge the capacitor, through the resistor, to 63.2 (â‰ˆ 63) percent of full charge; or to discharge it to 36.8 (â‰ˆ 37) percent of its initial voltage. These values are derived from 1 âˆ’ e âˆ’ 1 and e âˆ’ 1 respectively.
It is important to keep in mind that one must apply a voltage across the capacitor at its rated value. Thus, if it is a 400V capacitor driving a tube amp, for instance, it must be driven at around 400V. Driving it at 12V will lead to useless results.
The only proper way to check for a capacitor value and or leakage is with a proper test bridge: set it to the capacitor's DC rating with it removed from the circuit completely. Any other way is just waste of time.
Additionally, a common in-circuit test for a electrolytic capacitor is to measure its Equivalent Series Resistance (ESR) which can be done with an ESR meter. This is a quick and easy way to locate failing electrolytic capacitors, especially in power supply circuits.
An effective method of testing any component in-circuit is with an in-circuit curve tracer. If you have an oscilloscope with X-Y input mode you can easily build one of these on your own. They do take some getting used to before you can use it effectively and are most useful for good board vs. bad boardcomparison.