Shashank
Shashank

Reputation: 339

How do we get the URL of the current page in Selenium RC for C#?

I am trying to get the URL of the current page in Selenium RC for C#. I don't want to get the href attribute of an icon, as I want to use it to compare it with the URL, the icon redirects you too.

Upvotes: 1

Views: 4730

Answers (1)

bob_1982
bob_1982

Reputation: 733

say you have defined it as

         IWebDriver wb;
         wb = New FirefoxDriver();
         wb.Navigate.GoToUrl("http://gogoel.com");

then to get current url use

          String ptr=wb.Url;

Upvotes: 1

Related Questions