This is a migrated thread and some comments may be shown as answers.

Finding Focus

1 Answer 126 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ankit
Top achievements
Rank 1
Ankit asked on 16 Sep 2013, 09:28 AM
How to check whether the focus is present on a particular element or not.

For e.g say i have two UI Elements and on first element i have configured onChange behavior.And once onChange is fired , focus should go to second element. So how to check whether focus is present on second element or not.

1 Answer, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 17 Sep 2013, 07:57 AM
Hi Ankit,

Thank you for contacting us.

There is no way how to check if the element is focused, however you can set the focus to the element via this code:

Pages.YourApp.YourElement.Focus();

It seems you are trying to do UI testing instead of a business logic testing. I can advise you to do this type of testing manually. Trying to automate this is too brittle to be productive. Also it’s the type of testing you do once in a while, far apart. It doesn't make sense to put into a nightly test run.

Hope this helps.

Regards,
Boyan Boev
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Ankit
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
Share this question
or