18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
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.
Obtaining Part of a Url
I have the following line in my for loop. Everything is work except I cannot for the life of me figure about to get part of a url. here is the line I have to get it:
record_id = _link(_getText(_cell(usertable, i, 1))).slice(35);
This of course is in a function wrapped in browser tags.
here is a sample of the full code:
record_id = _link(_getText(_cell(usertable, i, 1))).slice(35);
This of course is in a function wrapped in browser tags.
here is a sample of the full code:
<browser>
function CopyRecords() {
var usertable = _table(18);
var records = new Array();
for(var i = 0; i < usertable.rows.length; i++){
records[i] = new Array();
if(i = 0) {
} else {
//Record Name
record_name = _getText(_cell(usertable, i, 1));
//Nation ID
record_id = _link(_getText(_cell(usertable, i, 1))).slice(35);
records[i][0] = record_name;
records[i][1] = record_id;
}
}
return records;
}
</browser>
_set($roster, CopyRecords());
for (var $i=0; $i<$roster.length; $i++){
_debug(_cell($roster[$i][0]));
_debug(_cell($roster[$i][1]));
}
Comments
_link(text) returns the DOM Element of the link. What you need is _link(text).href