I am trying to click a button, which is in the popup, but it is giving me the following error:
Message: Element <button id="modal_ok" class="btn btn-primary waves-effect waves-light" type="button"> could not be scrolled into view
My HTML content for this is:
<button type="button" id="modal_ok" onclick="$('#disable_1').hide(); $('#form_disable_1').submit();" class="btn btn-primary waves-effect waves-light">Ok</button>
The code I have written is as follows:
ok_button = browser.find_element_by_id("modal_ok")
self.assertIsNotNone(ok_button)
# ok_button.click()
WebDriverWait(browser, 20).until(EC.element_to_be_clickable((By.ID, "modal_ok"))).click()
The assert is working, which means the element is visible, but I am not able to click it because of the aforementioned error.