user812142
user812142

Reputation: 173

Protractor not able to find element in Overlay

I am trying to get text of an error message using protractor-typescript. The message appears for few seconds only.

below is the complete HTML of the element:

<mas-popup-message _ngcontent-c24="" _nghost-c6="" class="ng-star-inserted">
<div _ngcontent-c6="" class="report-panel__container">
  <i _ngcontent-c6="" class="material-icons close">close</i>

  <div _ngcontent-c6="" class="report-panel__container-columns ng-star-inserted">
  <div _ngcontent-c6="" class="report-panel__container-columns-content-error">User Creation Failed</div>
  </div>
    <!---->
    <!---->

</div>
</mas-popup-message>

i have tried below code

  browser.wait(EC.visibilityOf(element(by.tagName("mas-popup-message"))),5000,"error returned");

i have used isDisplayed(), isPresent(), EC.presenceOf but it is returning same error in each case.

NoSuchElementError: No element found using locator:

locators which i am using is correct. I think the element is in overlay but it is not an iframe. Can anyone help what can be the possible solution?

Upvotes: 0

Views: 354

Answers (1)

Kacper
Kacper

Reputation: 1199

Try to use: browser.wait(EC.visibilityOf(element(by.css("mas-popup-message"))),5000,"error returned");

Upvotes: 1

Related Questions