admin管理员组

文章数量:1435859

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 ments will be helpful, thanks very much.

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 ments will be helpful, thanks very much.

Share Improve this question edited Jul 24, 2015 at 3:24 alecxe 475k127 gold badges1.1k silver badges1.2k bronze badges asked Jul 24, 2015 at 2:43 RosalineRosaline 612 silver badges3 bronze badges 1
  • Maybe browser.actions().click(protractor.Button.LEFT).perform(); – Chong Tang Commented Jul 24, 2015 at 2:58
Add a ment  | 

2 Answers 2

Reset to default 6

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.

in such cases you can click on document.body

if you are testing a directive you need to append it to the body first.

element = angular.element('<your-directive></your-directive>');
pile(element)(scope).appendTo(document.body);

本文标签: javascriptProtractor How to click on a blank placeStack Overflow