During sign in on Yahoo mail, cursor is focused on Yahoo ID text field automatically. I want to verify whether cursor is focused or not on Yahoo ID text field. HTML for the text field is below:
<input name="login" id="username" maxlength="96" tabindex="1" value="">
How can I verify that Yahoo ID text field is focused or active?
BTW, I am using WebDriver (Selenium 2) with java, TestNG as test framework
I think, the following code would work. Please try the following: