I am trying to select the confirmation box using Python and Selenium. I am able to click the 'Transfer' button then I am prompted with the following message "Are you sure you want to transfer the selected account items and permissions to Backup Backup (backup)?" Then there are two buttons
1."Cancel"
2."OK"
Click transfer button to transfer account
When I get to this part, I am unable to get Selenium to go to the next step, which is clicking the "OK" button.
"OK" button to confirm account transfer
Below is the HTML.
<div style="padding-top: 15px;">
<input id="submit_transfer" class="button" name="submit_transfer" onclick="return verifyTransfer('');" value="Transfer" type="submit"/>
<input id="do_transfer" name="do_transfer" value="0" type="hidden"/>
<input id="delete_user" name="delete_user" value="0" type="hidden"/>
<input id="cancel_transfer" class="button" name="cancel_transfer" value="Cancel" type="submit"/>
</div>
def transfer_account(drive):
"""
:param drive:
:return:
"""
transfer_account_xpath = ".//*[@id='submit_transfer']"
test = ".//*[@id='submit_transfer']"
transfer_account_ = drive.find_element_by_xpath(transfer_account_xpath)
transfer_account_.click()
al = driver.switch_to.alert()
print al.text
time.sleep(3)
# result = None
# try:
# except UnexpectedAlertPresentException:
# print 'error'