Search Here!

Tuesday, April 24, 2012

Selenium RC: RedirectToPage


There are various scenarios when we need to switch in between different URL's. This C# method helps to redirecting page from one to another in a very generic manner.

public static void RedirectToPage(string url)
        {
            ISelenium Selenium = GetSeleniumInstance();
            Selenium.SelectWindow("");
            Selenium.GetEval("javascript{ (function() { var txt=selenium.browserbot.getCurrentWindow().location ='" + url + "'; return '';})(); }");
        }

No comments:

Post a Comment