Hi,
For a reliable solution you should disconnect the capacitor from any other circuitry. Else the circuitry may cause error in ohm reading.
Mind to discharge the capacitor before disconnecting it from circuitry / before touching it or connecting it to measurement device.. The stored energy may hurt you and/or the measurement device.
Btw. Your measurement shows only the leakage resistance of the capacitor. With large capacitors this may need an indefinite time! And additionally the resistance value depend on quality, age, size, manufacturer, type, and chemistry .... of the capacitor.
A value of 100k may be a very good value for a large electrolytic capacitor, but a very poor value for a film capacitor.
Also mind that polarized capacitors show different values with reversed connection.
Klaus