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.
_navigateTo - variable
hi,
how to use : _navigateTo with a variable like this:
_navigateTo($linkArray[0]); or _navigateTo($link)
or
_call(window.open($linkArray[0], "MyWindowName"));
or
browser.navigateTo($linkArray[0]);
it doesnt work :-(
how to use : _navigateTo with a variable like this:
_navigateTo($linkArray[0]); or _navigateTo($link)
or
_call(window.open($linkArray[0], "MyWindowName"));
or
browser.navigateTo($linkArray[0]);
it doesnt work :-(
Comments
var $ar = "http://www.sahi.co.in/demo", "[url]http://www.sahi.co.in/forums[/url]";
_navigateTo($ar[0][0]);
_navigateTo($ar[0][1]);
its working fine. Can you tell me what error you are getting in the logs?
var j = 24 ;
for(var i = 0; i < 20; i++){
$linkArray = top.document.links[j];
j++; j++;
}
// browse the saved links
_navigateTo($url);
//
var j = 24 ;
for(var i = 0; i < 20; i++){
$linkArray = top.document.links[j];
j++; j++;
}
// browse the saved links
$url = $linkArray[0];
_navigateTo($url);
//
var $linkArray = top.document.links[j];
then $linkArray will be considered as a string and not as an array. so $linkArray[0] returns first character of the string.
Try using it as
and make sure that url in $linkArray[0] is formatted correctly by alerting it.
by alert the url from $linkArray[0] is formatted correctly.
To fetch values from the browser, you need to use _set.
A simple sample script is here:
the system seems not accept :
_set($href, top.document.links[$i].href);
var $linkArray = new Array();
// copy the links
var j = 24 ;
for(var i = 0; i < 20; i++){
$linkArray = top.document.links[j];
j++; j++;
var $url = $linkArray[0];
_call(window.open($url, $url ));
_wait(6000);
}
//
it works now, thank you for support.