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.