This is a difficult problem. Components tend to be connected on a board, and these connections corrupt the readings.
Many manufacturers, starting in the 1960s when automatic test equipment was just starting to be computer controlled, like Teradyne and Marconi Instruments to mention a couple, came up with a way of making some of these measurements.
In the best case, these connections can be 'guarded out'. This is essentially an extension of a 4 wire measurement.
Let's say you have a pi attenuator, and you want to measure the series resistor R2 (from that link). You would apply a known voltage to one port, so the current down R1 is irrelevant, and measure the current through R2 using a virtual ground amplifier across R3. To do this, you also need a connection to the ground, this is called 'guarding out' the ground connetion. As there is no voltage on R3, no current flows in it, so all the flowing current comes through R2. This allows calculation of R2.
Unfortunately, some components are just not feasible to guard out. The guard node might not be accessible. You might not have enough dynamic range to control the guarded components.