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.

Problem to access to html tag content

vivovivo Members
edited August 2012 in Sahi - Open Source
Hi
My test criteria here is if a particular word is present on the whole html page (including head section also)
It's mass test - script checks around 500 urls
It works fine for 95% of cases , but for the rest there is a problem
I get null instead of page content

The code that reproduces the problem is the following

=========================

<browser>

var GetWholeHTML = function(){
return document.documentElement.innerHTML;
}

</browser>


var ProcessTest = function() {

// I coud not post link because I'm new here

_navigateTo("http===french dot eurokingclub dot com");

var $elemStr;
try{
_set($elemStr , GetWholeHTML ());


}catch(e){

}

_alert($elemStr);

}


ProcessTest ();

===================

I'm using

windows 7

FF 14.0.1

sahi_v35_20110719


Also , if you have better idea how to get page contents , I'll appreciate


Thanks in advance

Comments

  • well.. spontaneously I would use
    var $wholeHtml=_getText(document.head)+_getText(document.body)
    
    just because I hate these functions in browser tags^^ they fuck up the IDEs checkstyle
    maybe this produces better results too ;)

    Are the pages which return null special in any way? maybe 404 pages?


    Regards
    Wormi
  • vivovivo Members
    edited August 2012
    Thanks for quick answer
    I tried your advise but
    got null again


    This is from Sahi Log:


    setServerVar('___lastValue___1344522747189', _getText(null));
    _alert(null);
  • Ahhh ok.. it works from the Sahi Controller.. but not from the scripts...
    damn, I have no idea then... sorry
  • vivovivo Members
    Any other ideas on that?
Sign In or Register to comment.