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.
getting href from table
Hello,
I'm able to get the text from a particular table using _getCellText
var $tabledata;
_set($tabledata, _getCellText(_table(12)));
How can I get the href info contained within that same table?
Thanks
Change of subject.
VNC hint:
If you are using VNC to remotely access a Firefox and Sahi session on a linux machine from another linux machine the Ctrl_Alt_DblClick won't be passed.
Funny thing is it works fine from a XP machine to a linux machine.
Simple solution is to just open a new tab and enter a URL on the remote machine.
A new Sahi Controller window should automatically open for the new tab.
This is also covered in the FAQ:
http://sahi.co.in/w/help-the-sahi-controller-does-not-come-up
I'm able to get the text from a particular table using _getCellText
var $tabledata;
_set($tabledata, _getCellText(_table(12)));
How can I get the href info contained within that same table?
Thanks
Change of subject.
VNC hint:
If you are using VNC to remotely access a Firefox and Sahi session on a linux machine from another linux machine the Ctrl_Alt_DblClick won't be passed.
Funny thing is it works fine from a XP machine to a linux machine.
Simple solution is to just open a new tab and enter a URL on the remote machine.
A new Sahi Controller window should automatically open for the new tab.
This is also covered in the FAQ:
http://sahi.co.in/w/help-the-sahi-controller-does-not-come-up
Comments
Used the info from this thread: http://sahi.co.in/forums/viewtopic.php?id=860
var $url;
_set($url, _link(_getText(_cell(_table(16),0,2))).href.slice(35));
One warning: The first table row and column is 0,0 NOT 1,1 .
Should have caught that sooner but old (matrices) habits die hard.
Question:
What is the propose of "slice(35)". Can't find any documentation, other than the mentioned thread, but it works.
Thanks to Narayan for the answer.
You can also find the link inside that cell using regular javascript via
_cell(_table(16),0,2)).getElementsByTagName("A")[0]
What we are doing is finding the first A tag inside the cell.
slice gives you a portion of an array (and strings). Have a look at http://www.w3schools.com/jsref/jsref_slice_array.asp
Regards,
Narayan
Will Do.