WebDriverError: element click intercepted:Element is not clickable at point Other element would receive the click

Viewed 1503

I am getting the below error while creating an automation Test case for one of my UI flow. I am able to locate the checkbox element in the UI but after running the program getting this error. I tried sleep(), Loaderwait and other solutions but nothing is working. need a help for this. Thanks

WebDriverError: element click intercepted: Element is not clickable at point (306, 403). Other element would receive the click: ... (Session info: chrome=80.0.3987.149) (Driver info: chromedriver=80.0.3987.106 (f68069574609230cf9b635cd784cfb1bf81bb53a-refs/branch-heads/3987@{#882}),platform=Windows NT 10.0.18363 x86_64)

```Then ("I Enter Truck ELD Provider In select ELD provider Field", async  ()=> {
  await $fk.lookup("text").click();
  await $fk.lookup("text").enter_value("Afaqy")
  await $fk.base_page.loaderWait(false);
  await $fk.base_page.click_on_first_suggestion();
});

Then("I click on Terms and conditions", async () => {
  await $fk.base_page.loaderWait(false);
  await $fk.checkbox("mat-checkbox-1-input").mouse_move();
  await $fk.checkbox("mat-checkbox-1-input").click();
});```
1 Answers

Option 1:

Use the following in your onPrepare hooks in your protractor config files.

onPrepare: ()=> { browser.manage().window().setSize(1600, 1000); }

Option 2:

Use expected condition to wait untill button is clickable

const EC = new protractor.ProtractorExpectedConditions();


 await browser.wait(EC.elementToBeClickable(locator for your button), 10000,' button is not clickable after 10 seconds')

Option 3:

Use actions to do a move move on element before you perform a click.

browser.actions().mouseMove(element).click();

(Or)

browser.actions().mouseMove(element).click().perform()
Related