t4t5 / sweetalert

A beautiful replacement for JavaScript's "alert"
https://sweetalert.js.org
MIT License
22.4k stars 2.84k forks source link

Sweet alert, Selenium, Visual Studio C# #919

Open xinwanc opened 4 years ago

xinwanc commented 4 years ago

Hi I would like to like to test my sweet alert pop up in Visual Studio with Selenium: Below is my code:

WebDriver.FindElement(By.Id("btn_submit")).Click();
WebDriver.FindElement(By.XPath("//div[@class='sweet-alert showSweetAlert visible']"));
var confirm_button = WebDriver.FindElement(By.XPath("//button[@class='confirm']"));
confirm_button.Click();

However, there is exception thrown which is unable to locate my XPath for sweet alert, please let me know on the correction of the syntax/sweet alert class/location.