4

I am trying to click the below button element:

<button _ngcontent-xjt-c6="" class="ef-ui-btn-inline-sm ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only" icon="pi pi-chevron-right" id="select-file-button" pbutton="" type="button" ng-reflect-icon="pi pi-chevron-right">
  <span aria-hidden="true" class="ui-button-icon-left ui-clickable pi pi-chevron-right"></span>
  <span class="ui-button-text ui-clickable">ui-btn</span>
</button>

If i try just click, everything works fine. The button gets clicked :

element.click();

But if i try below code,

let condition=await EC.elementToBeClickable(element);
console.log(condition)
await browser.wait(condition,5000,"Not avaiable for click within 5sec");
await element.click();

I am getting element not clickable message.

Could someone explain why expected condition not able to tell that the element is clickable?

0

Can you try one of these and let us know. Since you are unable to click on the element.

  1. use - browser.executeScript()
  2. or use actions command , move to the button and then click (i know this sounds weird, but please try once).

https://www.protractortest.org/#/api?view=webdriver.WebDriver.prototype.executeScript http://www.webdriverjs.com/javascript-executor-protractor/

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.