Is it okay to use rubber gloves to prevent electric shock?
You may use rubber gloves.
In IEC 61000-4-2, which is the standard for electrostatic testing, waveform verification is performed without human intervention, so during testing, either bare hands or gloves are acceptable. There is no specification for bare hands or glove use.
At our company, we conduct tests with bare hands from a workability perspective.