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
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.