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.

Using Variables in certain APIs dont work

shamsham Members
edited November -1 in Sahi - Open Source
hi all,

I"m having a concern with some of the APIs like
1.)_navigateTo()
2.)_expectConfirm()

Here is the issue.
var $dname = "data/a";
_navigateTo("/data/shares/?this_form=editfolshare_form&selfol=$dname&selsvc=nfs"); // DOES NOT WORK
_expectConfirm("Enable NFS share for folder $dname and its sub-folders?", true); // DOES NOT WORK

I've tried per-formatting the variable like this..
var $dname ="data/a";
var $href = "/data/shares/?this_form=editfolshare_form&selfol=$dname&selsvc=nfs"
_navigateTo($href); // DOES NOT WORK

it works with some APIs only like "_setValue(), _setSelected()" ..

Unfortuantely these are some of the most important APIs for me for which variables are failing..
Upon further investigation I've found that the framework passes these variables as "Literal strings" but does not do any substitutions..

Any ideas would be deeply helpful.

Thanks

OS :: Linux
sahi vers: 3.5

Comments

  • Hi sham

    you cant use variables in Strings
    You have to build these strings like
    _navigateTo("/data/shares/?this_form=editfolshare_form&selfol="+$dname+"&selsvc=nfs");

    Regards
    Wormi
Sign In or Register to comment.