18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

Is it possible to read url from current page?

tsivatsiva Members
edited August 2013 in Sahi - Open Source
I need to read the current page url and get the string of the url and then assert different values in the page based on the current URL. I know there is _readURL(url) API. But this will read the string if you give the URL value. but i don't want to specify a specific URL here. The url should be assigned dynamically from the current page. Can someone help me for this scenario? Thanks in advance for any kind of help.

Best Answer

  • edited August 2013 Answer ✓
    Hi tsiva,
    Please use the following code:
    var $url = _eval("window.location.href");
    

    Regards.

Answers

This discussion has been closed.