java.lang.RuntimeException: Cannot obtain keyboard focus.error when setFocus method used in Silk4J
I am trying to run some Silk4j keyword driven tests from SilkCentral. I trigger the scripts in SilkCentral from my local machine and the scripts run on a remote machine. I get an error 'Cannot obtain keyboard focus' wherever I have used SetFocus method in my script. Please let me now how to fix it
Do the keyword driven tests execute without error directly from your Silk4J client?
If so, are there any environmental difference between your Execution Server machines and your Silk4J client machine? Do you access your Execution Server machines via RDP?
I can only assume that if you use RDP, the RDP session has been minimized or closed forcing which causes the remote machine to enter GUI-less mode. This would prevent Silk4J from being able to assign keyboard focus to the control that you want to interact with.
Try connecting to the remote machine via RDP, then execute the test from Silk Central.
Do not minimize or close the RDP session while the test is running, does the error occur?