Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I verify 2 output values equal?
#1
Solved: 10 Years, 9 Months ago
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")
DbTable("DbTable_2").Check CheckPoint("DbTable_2")
and want to compare the #s I have from each line above.

Thank you!
Reply
#2
Solved: 10 Years, 9 Months ago
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.
Reply
#3
Solved: 10 Years, 9 Months ago
I guess what I'm trying to figure out is how to write the compare statement. Like if ____ = ____ then true, else false.
Reply
#4
Solved: 10 Years, 9 Months ago
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"))
checkdb = DbTable("DbTable_2").Check (CheckPoint("DbTable_2"))

If checkelem = Checkdb Then
  found = true
Else
  found = false
End If


Let me know if this was what you were looking for ?

-basanth
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#5
Solved: 10 Years, 9 Months ago
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,
Reply
#6
Solved: 10 Years, 9 Months ago
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.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#7
Solved: 10 Years, 9 Months ago
Thanks basanth..
Reply
#8
Solved: 10 Years, 9 Months ago
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")
Browser("Vis").Page("Vis").WebElement("15").Output CheckPoint("TotalB")

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....
Reply
#9
Solved: 10 Years, 9 Months ago
Okay..so the issue is reading the values from datatable ??
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#10
Solved: 10 Years, 9 Months ago
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?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [UFT] [WPF] Verify if the cell contains an image robertosalemi 0 1,778 10-25-2016, 06:57 PM
Last Post: robertosalemi
  Need to verify the drop down values based on condition santhoshmscsoftware 1 2,711 05-04-2016, 11:28 PM
Last Post: supputuri
  verify that parent properties match object currently displayed in your application. sona 0 2,943 02-21-2016, 12:00 PM
Last Post: sona
  Output Values error Tasleem 3 3,718 10-27-2014, 02:13 PM
Last Post: Tasleem786
Exclamation How to verify whether pdf is completely loaded or not in webpage nmakkena 1 2,477 08-27-2014, 04:09 PM
Last Post: vinod123

Forum Jump:


Users browsing this thread: 2 Guest(s)