Protractor: How to focus or blur an element?

Created on 27 Nov 2013  路  4Comments  路  Source: angular/protractor

How can I blur or focus an element? I'm using sendKeys method to input some text in a field but the element remains focused. I couldn't find a way to blur this element.

Thanks!

question

Most helpful comment

The webdriver-style way to do this is to do what a user would do - click on some other element.

All 4 comments

The webdriver-style way to do this is to do what a user would do - click on some other element.

Seems like this is resolved, closing for tidiness. Please open a new issue or pull request if there is still an issue.

I did that. But blur doesn't seem to trigger when using Chrome and the launched browser is not on focused or not the window that is currently active. I'm running multiple end-to-end test cases in parallel so only one window can be active or focused at a time.

You can read this https://github.com/angular/protractor/issues/1087 and this https://github.com/angular/protractor/issues/766 you need the browser to be focused (it is not an angular or a protractor issue)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

koshkarov picture koshkarov  路  3Comments

jmcollin78 picture jmcollin78  路  3Comments

psech picture psech  路  3Comments

mvolkmann picture mvolkmann  路  3Comments

luakri picture luakri  路  3Comments