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.
IF statement not working correctly in UBUNTU
Hi All,
Iam using the below code in sahi for assertion.In windows the same code works fine and the if condition works fine.
$Result = 0;
if (_assertExists(_image("Test")));
{
$Result == 1);
}
If the image("Test") doesnot exist on the page the verification fails and the variable $Result contains 0 and if the verification passes it gets updated by 1 in it as it enters in the if condiditon.
But at the same time if i run the same code in ubuntu it always going inside the if condition wheather the assertion is passes or failed the variable $Result always gets updated by 1.
Iam not able to find out why it is going inside the if condition even if the assertion fails.
Please help.
Thanks and Regards,
Aakash
Iam using the below code in sahi for assertion.In windows the same code works fine and the if condition works fine.
$Result = 0;
if (_assertExists(_image("Test")));
{
$Result == 1);
}
If the image("Test") doesnot exist on the page the verification fails and the variable $Result contains 0 and if the verification passes it gets updated by 1 in it as it enters in the if condiditon.
But at the same time if i run the same code in ubuntu it always going inside the if condition wheather the assertion is passes or failed the variable $Result always gets updated by 1.
Iam not able to find out why it is going inside the if condition even if the assertion fails.
Please help.
Thanks and Regards,
Aakash
Comments
is this assert nessacary? If not, you could rewrite it to which should behave equal on all OS.
Regards
Wormi