Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Protractor How to click on a blank place

We are using Protractor to test an Angular JS project. There is one page I need to click on a blank place (any blank place) to trigger the auto save after filled in all the required fields.

But I don't know how. I tried to find a useless image or click back on a text box. It cannot work.

Stacktrace:

UnknownError: unknown error: Element is not clickable at point (975, 357). Other element would receive the click: ...*

Any comments will be helpful, thanks very much.

like image 556
Rosaline Avatar asked Jul 24 '15 02:07

Rosaline


1 Answers

One option would be to find a particular element and click with an offset:

var elm = element(by.css('.material-dialog-container'));
browser.actions()
    .mouseMove(elm, -20, -20)
    .click()
    .perform();

Where the offset is counted from the top left corner of the element.

like image 177
alecxe Avatar answered Sep 19 '22 15:09

alecxe