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.

URL of current page

shreyshrey Members
edited November -1 in Sahi - Open Source
hi,

How can I get the URL of the current page?...My requirement is,

suppose I click on any link, I want to test that it should navigate to the specified link not the other link ..?? how can I test ? and yeah how can I use _readURL() ...??


Regards,
shrey

Comments

  • narayannarayan Administrators
    Hi Shrey,

    Use

    _assertEqual("http://myurl", top.location.href);

    Regards,
    Narayan
  • shreyshrey Members
    Hi,

    Thank you very much for help Mr. Narayana...

    Now I have problem dealing with downloaded file..I have read issues on forum regarding this but after trying all those solution still I am facing problem....

    I have scenario like this,

    On webpage I have directory structure showing in tree format and I have download button aside for download of that directory's contents..what is does , when i click on the download button It goes to the download.php link with the directory name parameter like this "download.php?d=./Documents" and make "directory name".tar.gz file that contains all the file which are in that directory...after that it can be downloaded

    I want to test that whatever file I download from that directory structure, it should download the same .tar.gz file which
    had the same directory name aside...

    but when I am using _LastDownloadedFileName() method it give me the name only download.php not "directory name".tar.gz.

    How to deal with these issue?..

    Please help..

    Regards,
    shrey
Sign In or Register to comment.