Powered By Blogger

Search Here!

Showing posts with label Redirect To Page. Show all posts
Showing posts with label Redirect To Page. Show all posts

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 '';})(); }");
        }