Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98814

How do I handle a simple Alert using C# and Selenium?

$
0
0

This is my code, when it gets to Switchto().Alert() there is an error saying 'No such alert'

            driver.FindElement(By.XPath("(.//*[normalize-space(text()) and normalize-space(.)='Add Document'])[1]/following::button[1]")).Click();

            **driver.SwitchTo().Alert().Accept();**

            var signFrame = driver.FindElement(By.Id("hsEmbeddedFrame"));
            driver.SwitchTo().Frame(signFrame);


            driver.FindElement(By.XPath("(.//*[normalize-space(text()) and normalize-space(.)='Istrong textnitials'])[1]/preceding::li[1]")).Click();strong text

Viewing all articles
Browse latest Browse all 98814

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>