Capture url in C # : Automation Tools

Capture url in C #

Ranorex Spy, Recorder, and Studio.

Capture url in C #

Postby Praveen597 » Mon Oct 03, 2011 7:57 am

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.
Praveen597
 
Posts: 24
Joined: Sat Aug 27, 2011 10:41 am

Re: Capture url in C #

Postby sdaly » Mon Oct 03, 2011 9:15 am

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;
User avatar
sdaly
 
Posts: 213
Joined: Mon May 10, 2010 12:04 pm
Location: Dundee, Scotland

Re: Capture url in C #

Postby Praveen597 » Wed Oct 05, 2011 1:05 pm

Thanks. It is working.
Praveen597
 
Posts: 24
Joined: Sat Aug 27, 2011 10:41 am


Return to Automation Tools

Who is online

Users browsing this forum: No registered users and 0 guests