Finding Focus

2 posts, 0 answers
  1. Ankit
    Ankit avatar
    4 posts
    Member since:
    Feb 2013

    Posted 16 Sep 2013 Link to this post

    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.
  2. Boyan Boev
    Boyan Boev avatar
    1072 posts

    Posted 17 Sep 2013 Link to this post

    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:


    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.

    Boyan Boev
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top