Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
08-06-2009, 08:37 PM
Assuming it is in globalsheet,
Code:
value1 = Datatable.Value("ColumnName")
value2 = Datatable.Value("ColumnName")
If Trim(value1) = Trim(value2) Then
found = True
Else
found = false
End if
Let me know if this helps.
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.
Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
08-07-2009, 03:38 PM
(08-06-2009, 08:58 PM)egun Wrote: [quote='basanth27' pid='6589' dateline='1249571256']
Hi Basanth,
Yes - I feel this is good progress! I have pasted my code below, but how can I print the results somewhere? Now that I know how to check/compare these values from my website vs my database I need to be able to print them somewhere to view at the end of the run. That is the last part. I appreciate your help immensely!
DbTable("DbTable_2").Output CheckPoint("DbTable_2")
Browser("Vis").Page("Vis").WebElement("15").Output CheckPoint("TotalB")
value1 = Datatable.Value("DbTable_TBills")
value2 = Datatable.Value("_15_innertext_out")
If Trim(value1) = Trim(value2) Then
found = True
Else
found = false
End if
You were almost there. You may have to get used on how to use QTP Help. In my view it is one of the most amazing storehouse of knowledge.
I assume you want to print the results to the QTP results, if yes this is how you do it,
Code:
DbTable("DbTable_2").Output CheckPoint("DbTable_2")
Browser("Vis").Page("Vis").WebElement("15").Output CheckPoint("TotalB")
value1 = Datatable.Value("DbTable_TBills")
value2 = Datatable.Value("_15_innertext_out")
If Trim(value1) = Trim(value2) Then
Reporter.reportevent micPass, "Value Match", "Found a Match"
Else
Reporter.reportevent micFail, "Value Match", "Values Dont Match"
End if
If you wanted to print the results somewhere other than QTP results let me know...
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.
Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
08-07-2009, 07:25 PM
Most Welcome
I request you & encourage to ask multiple questions and doubts. This is the place where we can learn and learn to share.
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.