Is there a way to test Polkadot and Kusama RPC client applications for a runtime upgrade before it gets enacted? i.e. Is there a way to emulate the upgraded runtime in a sandbox environment?
not sure what you want here, for test a runtime upgrade or a polkadot rpc client which will connect to the new runtime.
usually before on-chain upgrade in polkadot/kusama we use polkadot-launch to launch a test-net locally and do whatever test first
and for test a runtime upgrade you need to integrate try-runtime into your parachain nodes and test locally first