I am currently trying to select a checkbox button.
Here is the DOM code of the element:
<label><input type="checkbox" value="option-1">Option 1</label>
I have written a test using WebdriverIO and Mocha specifically for this scenario:
it("Click on checkbox button", () => {
browser.pause(5000);
const clickByXpathSelector = $("//div[@id='checkboxes']//input[@value='option-1']");
clickByXpathSelector.waitForDisplayed();
clickByXpathSelector.scrollIntoView();
clickByXpathSelector.click();
expect(clickByXpathSelector.isExisting()).to.be.true;
expect(clickByXpathSelector.isSelected()).to.be.false;
expect(clickByXpathSelector.isDisplayed()).to.be.true;
browser.pause(5000);
});
The error message received is:
unknown error: Element <input type="checkbox" value="option-1"> is not clickable at point (432, 220). Other element would receive the click: <p>...</p>
The element is clearly visible and not inside an iframe. Any suggestions on how to proceed?