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.

_setFile with %Desktop%

rj412rj412 Members
edited November -1 in Sahi - Open Source
_setFile(_file("document"), "C:\\Documents and Settings\\user1\\Desktop\\test.pdf");

how can I use environment variable %DESKTOP%? Anyone knows?

something like...
var $userDesktop = System.getProperty("user.home") + "/Desktop" ;
_setFile(_file("document"), $userDesktop + "test.pdf");

Comments

  • narayannarayan Administrators
    Pretty close. Try:

    var $userDesktop = java.lang.System.getProperty("user.home") + "/Desktop" ;
    _setFile(_file("document"), $userDesktop + "test.pdf");

    Regards,
    Narayan
  • rj412rj412 Members
    thanks Narayan - it worked.

    You may close the ticket.
This discussion has been closed.