Powered By Blogger

Search Here!

Showing posts with label Select and Close Window. Show all posts
Showing posts with label Select and Close Window. Show all posts

Tuesday, April 24, 2012

Selenium RC: Select and Close Window


This C# method provides you to select the pop-Up window name and close it in a definite interval of time. You need to pass pop-Up window name and time to wait in milliseconds.


public static void SelectAndCloseWindow(string popUpName, int insertDelay)
        {
            ISelenium Selenium = GetSeleniumInstance();
            Selenium.SelectWindow(popUpName);
            Selenium.Close();
            if (insertDelay > 0)
            Thread.Sleep(insertDelay);
        }