Site Loader
Auckland, New Zealand
In the last post we discussed how to work with popup windows using Coypu for Selenium C# an advanced wrapper for Selenium. In this post we will discuss how to work with Dialog boxes of application using Coypu. Here is the complete video Here is the complete code from the above video
        public void Test_DialogBox()
            var sessionConfiguration = new SessionConfiguration()
                Browser = Browser.Firefox,
                AppHost = "",

            var browser = new BrowserSession(sessionConfiguration);


            //Click Dialog

            bool hasDialog = browser.HasDialog("You generated a Javascript alert");

            //Assert if dialog present
            NUnit.Framework.Assert.That(hasDialog, "Should have this text");

            //Click Okay

            hasDialog = browser.HasDialog("You pressed OK!");

            //Assert if dialog present
            NUnit.Framework.Assert.That(hasDialog, "Should have this text");

Thanks for reading the post and watching the video!!! Please leave your comments and let me know if there is anything I should update in this post. Thanks, Karthik KK

Post Author: Karthik kk

Leave a Reply

Your email address will not be published. Required fields are marked *