I am writing a test for cancel a data request at the page: https://school.moodledemo.net/admin/tool/dataprivacy/mydatarequests.php
There is a pop-up when cancel a data request
My code to catch this:
def cancelRequest(self):
toggle_button = self.driver.find_element(By.ID, "action-menu-toggle-1")
toggle_button.click()
cancel_button = self.driver.find_element(By.ID, "actionmenuaction-1")
cancel_button.click()
try:
self.driver.implicitly_wait(10)
self.driver.find_element(By.LINK_TEXT, "Cancel request").click()
except:
print("nothing")
But I cannot choose the cancel request button. It always prints nothing. Can anybody help me? Thanks