Replacing a membrane switch with a relay for automated testing

That is correct. I don't know if the resistor and capacitor shown in the schematic will interfere with the switching via the relay or it is an issue with using a relay in this fashion.