Home > Enterprise >  Unable to click intercepted element in wdio 7
Unable to click intercepted element in wdio 7

Time:01-22

I'm using wdio 7 last couple of weeks. but still unable to resolve intercepted element.

In protractor, I'm using

            browser.actions().
            click($(".pay-modal-container i[class='webfont-date_range']")).
            sendKeys(protractor.Key.TAB).
            sendKeys(protractor.Key.TAB).
            sendKeys(protractor.Key.ENTER).
            perform();

Don't know In Wdio how it works. Please help me if anyone has an idea of it.

Note : Already used browser.execute("arguments[0].click()", locator); not doing anything if i used into script

CodePudding user response:

The ElementClickInterceptedException occurs when a pop-up gets in the way of a regular Selenium/WebDriver click, (eg: How do I close pop-up windows with Selenium in Python when I don't know when they will pop up?)

When that happens, you have two options:

  1. First click to close the pop-up that's in the way.
  2. Use a Javascript click instead of a regular click.

Given that WDIO is already a Javascript framework, you should have no troubles running a Javascript command to perform that click. Or you may decide to click to close the pop-up first.

CodePudding user response:

browser.performActions([{ "type": "pointer", "id": "click on add button", parameters: { pointerType: 'mouse' }, actions: [ { type: 'pointerMove', x: 1, y: 1, origin: browser.findElement("css selector", locator) }, { type: 'pointerDown', button: 0 }, { type: 'pointerUp', button: 0 }, ] } ]);

  •  Tags:  
  • Related