Micro Focus QTP (UFT) Forums

Full Version: Verifying value in calculated field
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all

I have a field called txtSalary and a field called txtSalaryDeduction
when i enter a value in txtSalary, txtSalaryDeduction is populated with the value of txtSalary minus 8%

Ex. entered 400.000 and the value of txtSalaryDeduction is: 368.000

how do I (in my qtp script) verify that this value is correct ?

I can get the value of txtSalary with the getRoProperty, but how do i do the calculation ?
ExpectedSalDeduct = txtSalary - (txtSalary * 8)/100

get the value from txtSalaryDeduction text field using GetRoProperty (say ActualSalDeduct) and validate

If Int(ExpectedSalDeduct) = Int(ActualSalDeduct) then

----