
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
java.lang.RuntimeException: Cannot obtain keyboard focus.error when setFocus method used in Silk4J
Hi ,
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
Regards,
Raghavan.S

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi @Raghavan_S
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?
Regards
Robert

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi Robert,
Yes , it is working fine on my local machine and yes , we are trying to run the script on a remote desktop.
Regards,
Raghavan.S

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi @Raghavan_S
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?
Regards
Robert