I'm writing an automation testing framework using Selenium. I am trying to Locate which element my cursor is pointing to.
for eg. there are two textbox
textbox2. If I perform a tab swift operation in java to move focus form
textbox2 such that now
textbox2 is at focus and the cursor position is moved, so is their any way to find in java whether the focus is actually shifted or not..
I usually try finding element such as,
driver.findElement(By.id("login_error")).getText().equals("Please enter Valid Data")
but finding by cursor is a new challenge for me which I am not getting through.
thanks in advance