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.
getText, containsText, and If does not work, does not function
Hi All,
I cant figure out why this codes does not work in sahi, it keeps logging error.
1.) I basically, just want to test if the text in the cell exist. The _cell does exist with the text.
if( _condition( popup(document.title)._getText( _cell(_table("T2"), 0, 1) )== "some text" ) )
_popup(document.title)._alert("some alert");
2.) Since the first does not function, so i made this, bust still doesn't work:
if( _condition( popup(document.title)._containsText( _cell(_table("T2"), 0, 1),"some text" )==true ) )
_popup(document.title)._alert("some alert");
3.) In this code, I try to assign the text value to $x.
var $x;
_popup(document.title)._set($x,_popup(document.title)._getText( _cell(_table("T2"), 0, 1)) );
//or another variation still does not work:
var $x;
_set($x,_getText( _cell(_table("T2"), 0, 1)) );
I tried everything but still does not work. I tried versions 2008, 2007 and 2006 and all errors.
Someone please help me. Tnx
I cant figure out why this codes does not work in sahi, it keeps logging error.
1.) I basically, just want to test if the text in the cell exist. The _cell does exist with the text.
if( _condition( popup(document.title)._getText( _cell(_table("T2"), 0, 1) )== "some text" ) )
_popup(document.title)._alert("some alert");
2.) Since the first does not function, so i made this, bust still doesn't work:
if( _condition( popup(document.title)._containsText( _cell(_table("T2"), 0, 1),"some text" )==true ) )
_popup(document.title)._alert("some alert");
3.) In this code, I try to assign the text value to $x.
var $x;
_popup(document.title)._set($x,_popup(document.title)._getText( _cell(_table("T2"), 0, 1)) );
//or another variation still does not work:
var $x;
_set($x,_getText( _cell(_table("T2"), 0, 1)) );
I tried everything but still does not work. I tried versions 2008, 2007 and 2006 and all errors.
Someone please help me. Tnx
Comments
Try this if it helps:
if( _condition(_getText( popup(document.title)._cell(_table("T2"), 0, 1) )== "some text" ) )
_alert("some alert");
Revert back with results/issues.
Regards,
Pankaj.
That is why i used the _popup(document.title)._getText .