Micro Focus QTP (UFT) Forums
Verifying value in calculated field - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Verifying value in calculated field (/Thread-Verifying-value-in-calculated-field)



Verifying value in calculated field - janriis - 04-20-2009

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 ?


RE: Verifying value in calculated field - dvkbabu - 04-21-2009

ExpectedSalDeduct = txtSalary - (txtSalary * 8)/100

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

If Int(ExpectedSalDeduct) = Int(ActualSalDeduct) then

----