Hope you are all doing good.
I am currently automating insufficient fund scenario for different type of payments for a banking app. I need to check if a payment has failed with the message Insufficient fund and mark the payment as Passed. For example, am doing an Own account transfer for which the payment has failed (Insufficient fund), then i need to insert “Passed” into excel sheet beside the payment type.
My Excel structure:
I do not want to specify the cell to insert the value. For example: put Msg into cell(“C3”) of AllPayment
What I did:
Before initiating the transfer, I insert the Payment type in Cell D2, for example D2 contain “Own account transfer”
Then am taking the whole column A to get the Payment Type, and am comparing the value with cell D2, if the Payment Type = value in cell D2 then insert “Passed” in cell C3 (Currently hardcoded)
set myWorkbook to WorkBook(ResourcePath(“UAT_Data.xlsx”))
set AllPayment to myWorkbook.Worksheet(“Juice_AllPayment”)
Put cell(AllPayment, “H2”) into Var_PT
Set Msg to “Passed”
//Retrive payment type for local bank transfer from excel
Put cell(AllPayment, “D5”) into Var_LocaltransferType
//Check if payment is fcy
Put cell(AllPayment, “E5”) into Var_FCY
Set LocalCur = “MUR”
put cellRange(“A”) of AllPayment into paymentType
put cellRange(“C”) of AllPayment into C
repeat until Var_PT is PaymentType
If Var_PT equals item 1 of PaymentType and if Var_FCY is LocalCur then
Log item 1 of PaymentType put Msg into cell("C3") of AllPayment --> Here am specifying the cell to insert the value Exit repeat else If Var_PT equals item 1 of PaymentType and if Var_FCY is not LocalCur then Log item 1 of PaymentType put Msg into cell("C17") of AllPayment Exit repeat else logError "Payment type not found" End if delete the first item of paymentType
What i want is, if the payment type is in cell A2, then insert he value in Cell C2 without specifying the cell. I want something like put Msg into cell(items) of AllPayment.
Thanking you in advance for your help.