Focus event when using input field

36 views
Skip to first unread message

Jessica Streicher

unread,
Jul 19, 2016, 12:14:05 PM7/19/16
to Selenium Users
I am a bit astonished to find that none of
- element.sendKeys
- element.click
- actions.click.perform

actually seem to fire an onfocus event. (I am using the FirefoxDriver in case its important)

I have an input field which changes its color on receiving focus, and i need to check that change in my test.
So far, the only way that change will actually be triggered is using javascript to set the focus. I find that somewhat hackish though.

Does anyone have any suggestions?

Thank you for your time!

Kaleem Uddin Mohammed Abdul

unread,
Jul 19, 2016, 12:32:47 PM7/19/16
to Selenium Users
actions.moveto is nothing but focus!

Jessica Streicher

unread,
Jul 20, 2016, 4:46:41 AM7/20/16
to Selenium Users
There is no method moveto on type Actions. 

I tried using moveToElement, but i'm afraid it is not working either - would have wondered about that working anyway, since the documentation only suggests mouse movement.
Reply all
Reply to author
Forward
0 new messages