Please note that Sahi's development and support teams do not actively monitor this. This is more a community forum. If you are a Sahi Pro user looking for commercial support, please email support @ sahipro.com with your query.

Why I'm getting [Script error. (:)]?

AneeshAneesh Members
edited March 2018 in Sahi Pro
I'm getting [Script error. (:)] on Script Report for most of my tests. It is showing up for both successful and failure tests. What does it mean and Why I'm getting it?

Following is one sample script.
var $url;
var $num = Number(_getText(_span("num-comments ")));
_set($url, window.location.href);
if ($url == "https://www.organicfacts.net/";){
	_assertNotVisible(_div("decomments-comment-section"));
}
else{
	if($num==0){
		_assertVisible(_div("decomments-comment-section"));
		_assertVisible(_div("To comment, please sign-in with any of the social networks below"));
	}
	else{
		_click(_link("Reply"));
		_assertVisible(_div("decomments-form-add-comment"));
	}
}

Test page: https://www.organicfacts.net/health-benefits/fruit/health-benefits-of-apple.html

Any kind of help or information is highly appreciated.

Best Answers

  • Answer ✓
    Hi Aneesh,

    These errors denote javascript errors in your web application (which you should be able to see on the web developer console of your browser). These errors may or may not cause your scenario navigation to fail. Your end user may be able to use your web application as intended, but if they opened the developer console, they would see these errors.

    Regards,
    Narayan
  • edited March 2018 Answer ✓
    If you do not wish to see the errors, you can add the onJSError() function in your script or global_include.sah
    onJSError.noLog= true;
    
    function onJSError($s){
    	return true;
    }
    _setXHRReadyStatesToWaitFor("2,3")
    _navigateTo("https://www.organicfacts.net/health-benefits/fruit/health-benefits-of-apple.html";);
    _assertVisible(_image("Organic Facts"));
    _call(location.reload());
    _assertVisible(_image("Organic Facts"));
    _call(location.reload());
    _assertVisible(_image("Organic Facts"));
    _call(location.reload());
    
    


Answers

Sign In or Register to comment.