Forum Discussion
If Discount and Amount are project variables, then use:
Project.Variables.Amount = aqConvert.StrToInt(InvoiceAmount) - aqConvert.StrToInt(Project.Variables.Discount)
If they are local variables, then use:
Amount = aqConvert.StrToInt(InvoiceAmount) - aqConvert.StrToInt(Discount)
To set the on-screen value, use
NameOfObjectToSet.set_text(Project.Variables.Amount)
or
NameOfObjectToSet.set_text(Amount)
Thanks Marsha.
It still is not giving me the calculated value, and does not enter any value into the field.
Discount_Amount and Bank_Amount are local variables.
But, Invoice Amount is a parameter, local to the test.
I have it now as:
Run Code Snippet Bank_Amnt = aqConvert.StrToInt(Invoice_Amount) - aqConvert.StrToInt(Discount_Amount)
Object SetText KeywordTests.My_Test.Variables.Bank_Amnt (also tried it as just Bank_Amnt)
- Marsha_R10 years agoModerator
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.
- DeepaJ10 years agoContributor
Marsha, what you have described seems to be the right solution and I have my test steps exactly like yours. However, it is still giving me a null or 0 as calculated result. When I log it, it returns empty message. On my screen, it seems to enter a null value.
I've attached the screenshot of the log.
- Marsha_R10 years agoModerator
See attached screenshot. Use messages like this right before the calculation and right after to display the variables and parameter so we can debug.
Related Content
- 6 years ago
- 4 years ago
- 8 years ago
Recent Discussions
- 2 days ago