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.
Upgrading to version 2
I am looking into upgrading to version 2 of Sahi
My code currently looks like this:
My question is where does the _popup go. Does it go in the getTextbox function, and if so how. I am a little confused
Many thanks
Donna
My code currently looks like this:
function getTextbox($control)
{
return _textbox($control).value;
}
function assertTextbox($popup, $control, $value, $space)
{
if ($popup == null)
{
_assertNotNull(getTextbox($control));
if ($space == null)
{
_assertEqual(trimITL($value, true), getTextbox($control));
}
else
{
_assertEqual($value, getTextbox($control));
}
}
else
{
_popup($popup)._assertNotNull(getTextbox($control));
if ($space == null)
{
_popup($popup)._assertEqual(trimITL($value, true), getTextbox($control));
}
else
{
_popup($popup)._assertEqual($value, getTextbox($control));
}
}
I think I need to wrap the browser tags around my getTextbox function.My question is where does the _popup go. Does it go in the getTextbox function, and if so how. I am a little confused
Many thanks
Donna
Comments
From the code above it appears that only the function getTextbox() is acting on the page's DOM. So I think only this function would need to be wrapped in the <browser> tag. Rest of the code should go as is. Lets discuss whereever you face problem in the code.
Regards,
Pankaj.
Donna you need to have the functions trimITL and getTextbox in <browser> tags.
If you are confused, have a look at the parsed script.
In V2 the script is executed on the proxy.
_sahi.schedule(command, debugInfo) will send the command to the browser. The browser will then eval it. So if you see your functions being a part of the command string, make sure that those functions are available on the browser by defining them within <browser> tags.
If you want a function to be executed on the popup, just call it like _popup("id")._click(myCustomFinder());
_popup should ideally never be used inside a browser function.
Thanks Narayan for the correction