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.
Updated variable value from function is not getting passed to the next function or step.
Hi,
Below the code which i'm using. Can anyone help to get the correct variable value.
Now, inside the function value is passed and it is getting updated in DB also correctly. but when i print it outside it is giving default value.
Please help !!
Deepika
[edit] edited for better code visibility
Below the code which i'm using. Can anyone help to get the correct variable value.
// Declaration of variables
$vResultFailed= "Failed";
$Flag_CustomerProfile =$vResultFailed;
if (_assertExists(_heading1("Customer Profile"))) {
validateCustomerProfile($accountNumber, $vTcIdCustomerProfile, $Flag_CustomerProfile);
_log("this is gobal variable");
_log($Flag_CustomerProfile);
}
//Function to validate Customer Profile
function validateCustomerProfile($accountNumber, $vTcIdCustomerProfile, $Flag_CustomerProfile){
if (_assertEqual($accountNumber, _getText(_span(17)))) {
_log("Customer Profile tab is passed : Account number is displayed correctly after account search.");
$vComment ="Customer Profile tab is passed : Account number is displayed correctly after account search.";
Flag_CustomerProfile =$vResultPassed;
updateDB($vTcIdCustomerProfile,"AccountNumber",$accountNumber, $vResultPassed, $vComment);
} else {
_log("Customer Profile tab is failed : Account number is not displayed correctly after account search.");
$vComment ="Customer Profile tab is failed : Account number is not displayed correctly after account search.";
updateDB($vTcIdCustomerProfile,"AccountNumber",$accountNumber, $Flag_CustomerProfile, $vComment);
}
}
Now, inside the function value is passed and it is getting updated in DB also correctly. but when i print it outside it is giving default value.
Please help !!
Deepika
[edit] edited for better code visibility