I am currently running in headless mode (uploaded in CirclCI Docker) and the site I am working on has an Accept Cookies banner. Apparently, in headless mode, it obscures the Log In button I need to click to be able to proceed with my test. Is there a way to disable checking?
We have .click({force: true}) in Cypress. Do we have a counterpart in Selenium?
Website is https://mailtrap.io/
Backstory:
Before going it Mailtrap, I came from another origin. I tried to use the Options() for Firefox before visiting Mailtrap but it doesn't work. If I put it at the first run, it messes up with the other site as well.
Here is the code:
options = Options()
options.set_preference("network.cookie.cookieBehavior", 2)
context.driver.get("https://mailtrap.io/signin")
loginButton = context.mailTrapPage.getLoginButton()
context.driver.execute_script("arguments[0].click();", loginButton)
Here is the error I'm getting:
selenium.common.exceptions.ElementClickInterceptedException: Message: Element <a class="login_next_button button button--medium button--block" href="#"> is not clickable at point (388,614) because another element <p class="cookies-banner__text"> obscures it
Stacktrace:
RemoteError@chrome://remote/content/shared/RemoteError.jsm:12:1
WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:192:5
ElementClickInterceptedError@chrome://remote/content/shared/webdriver/Errors.jsm:291:5
webdriverClickElement@chrome://remote/content/marionette/interaction.js:166:11
interaction.clickElement@chrome://remote/content/marionette/interaction.js:125:11
clickElement@chrome://remote/content/marionette/actors/MarionetteCommandsChild.jsm:204:29
receiveMessage@chrome://remote/content/marionette/actors/MarionetteCommandsChild.jsm:92:31