Im new using Selenium Webdriver and i couldn't automate a confirmation javascript onclick button, these button can't inspect to see the xpath;
the html button is:
<input type="button" class="ButtonEnable" name="Reset" id="Reset" value="Borrar todos los contadores " onclick="javascript:CallBack_Reset()">
and i try with the name or id
web_element = driver.find_element(By.NAME, 'Reset').click()
but appear a pop-up window with a confirmation
Update. I resolve it.
I use a selenium condition (alert) to javascript callback push-up windows.
the code to resolve it:
web_element = driver.find_element(By.NAME, 'Reset').click() WebDriverWait(driver, 5).until(EC.alert_is_present(), '¿Desea borrar todos los contadores?') alert = driver.switch_to.alert alert.accept()
Automate selenium webdriver python onclick javascript double confirmation