How can I verify 2 output values equal? - 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: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: How can I verify 2 output values equal? (/Thread-How-can-I-verify-2-output-values-equal) Pages:
1
2
|
How can I verify 2 output values equal? - egun - 08-05-2009 I need to check that my output from my DB checkpoint equals a stored value on my web page. So I have the 2 values stored in my Global list, I just need to check whether they are the same. Numeric values I'm using QTP 9.5 So far I have: Code: Browser("Vis").Page("Vis").WebElement("B").Output CheckPoint("TotalB") Thank you! RE: How can I verify 2 output values equal? - QTPian - 08-05-2009 Get the runtime value present in the webelement using GetROProperty and save it in the datatable. Now insert a DB checkpoint and parameterize the same with the data that was stored in the Datatable. RE: How can I verify 2 output values equal? - egun - 08-05-2009 I guess what I'm trying to figure out is how to write the compare statement. Like if ____ = ____ then true, else false. RE: How can I verify 2 output values equal? - basanth27 - 08-06-2009 Eugen, I am not very sure if this what you are looking for, but from what i understood i framed the below. Code: checkelem = Browser("Vis").Page("Vis").WebElement("B").Output (CheckPoint("TotalB")) Let me know if this was what you were looking for ? -basanth RE: How can I verify 2 output values equal? - QTPian - 08-06-2009 Egun, I don't understand why you are looking for "if condition", when there is a database check point. The Checkpoint is itself an if condition. Explanation of your scenario may help us to identify the solution... Thanks, RE: How can I verify 2 output values equal? - basanth27 - 08-06-2009 QTPian, Database checkpoint pass/fail is on the QTP test results and not on your customised reporting. Sorry for misleading...Please ignore the above statement. I wrote it up in haste. You cannot retrieve the value from a DB checkpoint, rather it returns true or false depending on the match. Egun - is your scenario something like, you have a name on the web and you want to verify through db that the value coming up on web and the value stored in the DB match ?? if yes, then it cannot be done through checkpoint the way you want it. It can be done programatically. RE: How can I verify 2 output values equal? - QTPian - 08-06-2009 Thanks basanth.. RE: How can I verify 2 output values equal? - egun - 08-06-2009 Yes, the scenario that I'm trying to check if if the value show on my website is equal to a value in my DB. They should match. So I should try to check this using a checkpoint? I suppose I can try that.... I just am not sure how to formulate it. Maybe I can clarify a little better... Code: DbTable("DbTable").Output CheckPoint("DbTable") after this is run, in my Test Results - Run-Time Data Table I get values 15 in both cells for these 2 statements. So I have the values (from website and from DB), now I would like to compare them to ensure they match. Does this make sense? Thank you for your responses.... RE: How can I verify 2 output values equal? - basanth27 - 08-06-2009 Okay..so the issue is reading the values from datatable ?? RE: How can I verify 2 output values equal? - egun - 08-06-2009 Yeah, how can I compare the 2 values I have stored in the run-time datatable? And store the result of the comparison in a report. I think there's a reporter functionality right? |