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.
Script stops after using _setValue for a textbox
Hey guys,
I am currently encountering this problem when my script executes - the script stops after using the _setValue function. Here is a snippet of my code...
<browser>
function screenCheck(target)
{
return _assertExists(target);
}
</browser>
var $macroScreen2 = false;
while ($macroScreen2 == false){
_set($macroScreen2, screenCheck(_spandiv("ctl00_ContentPlaceHolderMain__wizard__labelMacro_lblQt2")));
_click(_spandiv("ctl00_ContentPlaceHolderMain__wizard__labelMacro__txtMacroName:hint"));
_setValue(_textbox("ctl00\$ContentPlaceHolderMain\$_wizard\$_labelMacro\$_txtMacroName"), "macro1");
_click(_imageSubmitButton("ctl00_ContentPlaceHolderMain__wizard_StepNavigationTemplateContainerID__imgNextButton"));
}
The end result of this code is that the text "macro1" is entered correctly in the textbox, but the script stops there for some weird reason. The same result occurs when using the recorder as well.
Any suggestions/tips would be greatly appreciated.
Thanks!
I am currently encountering this problem when my script executes - the script stops after using the _setValue function. Here is a snippet of my code...
<browser>
function screenCheck(target)
{
return _assertExists(target);
}
</browser>
var $macroScreen2 = false;
while ($macroScreen2 == false){
_set($macroScreen2, screenCheck(_spandiv("ctl00_ContentPlaceHolderMain__wizard__labelMacro_lblQt2")));
_click(_spandiv("ctl00_ContentPlaceHolderMain__wizard__labelMacro__txtMacroName:hint"));
_setValue(_textbox("ctl00\$ContentPlaceHolderMain\$_wizard\$_labelMacro\$_txtMacroName"), "macro1");
_click(_imageSubmitButton("ctl00_ContentPlaceHolderMain__wizard_StepNavigationTemplateContainerID__imgNextButton"));
}
The end result of this code is that the text "macro1" is entered correctly in the textbox, but the script stops there for some weird reason. The same result occurs when using the recorder as well.
Any suggestions/tips would be greatly appreciated.
Thanks!
Comments
The page that it navigates to has been cached on the browser and the cached copy is being picked which does not have Sahi's injected code. Try clearing the browser cache before you run the test.
The funny thing is, that in other textboxes, _setValue does not "hang". I am thinking it may be something to do with the webpage code, as Sahi seems to be waiting for something to complete.
Is there possibly anything else I am missing here? Is there any other way to debug it other than using the logs?
When it hangs, go to the recorder tab and type _sahi.areXHRsDone() in the "Evaluate Expression" box, click "Test ->" and see what it shows.