I have a form that focuses a different component based on state when it loads. Is there a way with WicketTester, or some other Wicket test tool, to determine which component currently has focus?
For example, a form with username and password. When username is present then the password field gets focus and when it is not present username field gets focus.
Here is how I set focus in a temporary Behavior...
response.render(OnDomReadyHeaderItem.forScript("document.getElementById('" + component.getMarkupId() + "').focus();"));