Calculate value of variable using parameter default value and an on-scree object variable value
I have a parameter (Invoice Amount), which has a default value of 1000. I have a variable (discount), whose value I get from an on-screen object. I need to calculate the value of Amount (which is another vaiable). I need this value to be stored and entered into the text field of another on-screen object. The calculation is simple - Amount = Invoice Amount - Discount.
I am not sure how to reference parameters and variable in VBScript. I keep getting an error that it is not running the test.
I also tried 'Run Code Snippet' with value as
Execute(KeywordTests.MY_Test.Parameters.Invoice_Amount - KeywordTests.MY_Test.Variables.Discount_Amount).
However, it just enters this string as the value into the on-screen, text field instead of the calculated value.
Any help or suggestions would be greatly appreciated.
Deepa.
See attached screenshots. I wrote the total into a remarks field that's text so you can see the layout. If you still aren't seeing the correct calculations, put log messages at the top and display each one of the variables so you can see what the values are at the beginning.