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.

Script stops after using _setValue for a textbox

yellowg555yellowg555 Members
edited November -1 in Sahi - Open Source
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!

Comments

  • Forgot to mention that if I browse to another screen/page, the script resumes. I just don't get why it stops/pauses after inserting a value into this particular textbox.
  • narayannarayan Administrators
    This could be a possible reason:
    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.
  • I cleared the cache with no luck. It still "hangs" after inserting the text into the textbox.

    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?
  • narayannarayan Administrators
    Is there any ajax activity on the browser, when you set a value to that textbox?
    When it hangs, go to the recorder tab and type _sahi.areXHRsDone() in the "Evaluate Expression" box, click "Test ->" and see what it shows.
  • I believe there is ajax activity on this page. Testing that expression you gave me evaluates as true.
Sign In or Register to comment.