Ask a Question

switch statement on assert element

SOLVED
DainiusA
Contributor

switch statement on assert element

Hello,

 

I am trying to make a switch statement on returned text for the first time. But I am doing something wrong. Can anyone guide me to the right path ?

 

function test ()
{
AssertSum = Aliases["Kernel"]["MainForm"]["CheckControl"]["zcheckTop"]["lblSum"]["Text"];
switch (AssertSum)
{
case AssertSum("56,22"):
SumButtonClick()
PaymentWindowClickCash()
PaymentWindowClickPay()
PaymentWindowClickFinalizePayment()
break;

case AssertSum("0,91"):
SumButtonClick()
PaymentWindowClickCash()
PaymentWindowClickPay()
PaymentWindowClickFinalizePayment()
break;

case AssertSum("40,63"):
SumButtonClick()
PaymentWindowClickCash()
PaymentWindowClickPay()
PaymentWindowClickFinalizePayment()
break;

default:
Log["Error"]("There is no sum like this")
break;
}
}

2 REPLIES 2
ebarbera
Staff

Hi @DainiusA - 

 

What is the error you are receiving? Or how is this not working in the expected way?

 

Thanks, 
Emma

Hello @ebarbera ,

 

Thank you for your response, but I sorted this out just through if... else for now.

cancel
Showing results for 
Search instead for 
Did you mean: