Feb-06-2018, 10:07 PM
Hello,
I am new to this and I am trying to click on a button with selenium and chromedriver, the button element is as below:
<button class="pagination-button pagination-direction pagination-direction--next" data-bind="click: goto.bind($data, 'next'), disable : isOnLastPage" data-test="pagination-next"> <span>Next</span> <div class="no-svg-chevron pagination-chevron pagination-chevron--forward pagination-chevron--next"> <svg> <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#core-icon--chevron"></use> </svg> </div> </button>
I have tried with xpath and find element by class name, but click or submitting is not working.
Find below an extract of the different codes:
and the error:
selenium.common.exceptions.NoSuchElementException: Message: no such element: Element was not in a form, so could not submit.
another test:
the error:
Any help would be appreciated.
Thanks,
Gilles95
I am new to this and I am trying to click on a button with selenium and chromedriver, the button element is as below:
<button class="pagination-button pagination-direction pagination-direction--next" data-bind="click: goto.bind($data, 'next'), disable : isOnLastPage" data-test="pagination-next"> <span>Next</span> <div class="no-svg-chevron pagination-chevron pagination-chevron--forward pagination-chevron--next"> <svg> <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#core-icon--chevron"></use> </svg> </div> </button>
I have tried with xpath and find element by class name, but click or submitting is not working.
Find below an extract of the different codes:
1 2 |
button = driver.find_element_by_class_name( 'pagination-direction--next' ) button.click() |
Error:selenium.common.exceptions.WebDriverException: Message: unknown error: Element <button class="pagination-button pagination-direction pagination-direction--next" data-bind="click: goto.bind($data, 'next'), disable : isOnLastPage" data-test="pagination-next">...</button> is not clickable at point (820, 853). Other element would receive the click: <button class="button" data-bind="click: closeMessage" data-test="close-cookie-popup-button">...</button>
if I replace click() by submit, I get the below error:selenium.common.exceptions.NoSuchElementException: Message: no such element: Element was not in a form, so could not submit.
another test:
1 2 |
button = driver.find_element_by_xpath( "//*[@id='l-container']/div[3]/div/div/div/div[3]/button" ) button.click() |
Error:selenium.common.exceptions.WebDriverException: Message: unknown error: Element <button class="pagination-button pagination-direction pagination-direction--next" data-bind="click: goto.bind($data, 'next'), disable : isOnLastPage" data-test="pagination-next">...</button> is not clickable at point (820, 853). Other element would receive the click: <button class="button" data-bind="click: closeMessage" data-test="close-cookie-popup-button">...</button>
From this last error message it seems I need to find "button class="button" data-bind="click" but I can't find it in the source of the page, hence difficult to capture it as element with selenium and chromedriverAny help would be appreciated.
Thanks,
Gilles95