lundi 8 janvier 2018

Django LiveServerTest and javascript : how to let user enter confirmation?

using Django and LiveServerTest, I am testing this url :

#template.py
<div id = "id_delete"><a href="//delete/" onclick="return 
confirm('Are you sure ?')">delete</a></div>

#tests.py
self.selenium.find_element_by_xpath('//*[@id="id_delete"]/a').click()

and I wish Selenium to pause to let me click on "cancel" when javascript asks 'Are you sure ?' and go on with the following tests.

Aucun commentaire:

Enregistrer un commentaire