c# - How to handle modal dialog in selenium webdriver? -
i have come across modal dialog on web page. have select yes in modal dialog not able select it. have tried alert alternative not working. code have tried is
ialert alert = driver.switchto().alert(); alert.accept();
this code not working modal dialog.
the code suggested used handle alerts:
driver.switchto().alert();
it won't work modal window.
you need handle modal window differently, ordinary webelement. example:
remove().click() //operation leading appearance of modal window val modalwindow = driver.findelement(by.cssselector(".modal")) //modal window, check dom it's right selector acceptdeletionmodal.your_operation
c# selenium-webdriver modal-dialog
No comments:
Post a Comment