Micro Focus QTP (UFT) Forums
Need code to compare wording in a web object pop-up with database - 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: Need code to compare wording in a web object pop-up with database (/Thread-Need-code-to-compare-wording-in-a-web-object-pop-up-with-database)



Need code to compare wording in a web object pop-up with database - JJ66 - 02-21-2010

Ankur, Saket/ other QTP Gurus,

I am planning to implement a QTP script that will click on a web object in my application under test, compare the wording in the pop-up that appears with the value in the relevant database field at the back end. If both are identical, show the test case as Passed, otherwise Fail he test case. QTP should connect to the database to do the above.

Thank you in advance for your help. You guys are awesome!


RE: Need code to compare wording in a web object pop-up with database - Saket - 02-22-2010

Hi,
have you tried anything, in which part you are facing problem.
paste your peice of code here so that we can help in better way.
providing the code is never a good idea,we can provide you the guidelines and would like you to code which will help you to learn more Smile

1. click on the object, say - Browser().Page().webButton().click
2. Check the popup exists and get the text appeared there - Browser().Dialog().getvisibletext or
Browser().Dialog().static().GetROProperty("text")
3. Connect to database (search this forum there are lots of thread discussed on this earlier)
4. get the required table field value using query
now you can compare the both

hope it helps


RE: Need code to compare wording in a web object pop-up with database - JJ66 - 02-26-2010

Thank you, Saket. That was very helpful. Appreciate it. I am going to test it later as soon as I find time from my current project.