Page 1 of 1

Capture url in C #

Posted: Mon Oct 03, 2011 6:57 am
by Praveen597
Hi All,

I want to capture URL of the current web page using C # code in Ranorex.

Can any one please help me out...?

I am trying to use this piece of code

string url = HttpContext.Current.Request.Url.AbsoluteUri;


But no use.

Thanks,
Praveen.

Re: Capture url in C #

Posted: Mon Oct 03, 2011 8:15 am
by sdaly
You need to first of all find the dom, then you can access the page url -

Code: Select all

Ranorex.Webdocument dom = "/dom[@domain~'ranorex']";

string pageurl = dom.PageUrl;

Re: Capture url in C #

Posted: Wed Oct 05, 2011 12:05 pm
by Praveen597
Thanks. It is working.