Micro Focus QTP (UFT) Forums

Full Version: Need code to compare wording in a web object pop-up with database
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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!
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
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.