In the communication you have setting for the HMI and for the PC. The test function works with whatever comms you set for the PC. So if you address a tag in the PLC and the runtime(test) doesn't see it, it's an error. If you create a HMI tag and you address it, then, no need of communication path, as even when not connected to PLC, your application can see it. So best option is to create an local HMI tag, that you use for test purpose. and you create a toggle button, connected to same tag, so you can change it.