Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help

Status
Not open for further replies.

gdafsu

MIS
Oct 31, 2005
4
US
I work in MIS but have been asked to create a QPT script without any knowledge of the program or manuals. My task is easy...there is a website at that allows a user to enter a vehicle VIN number and search NICBs database of abandonded vehicles.
I have a listing of thousands of VINs I need to look each up & want QTP to do it for me. I figured out how to pull the accounts from QTPs data table & look them up, but I can't get QTP to capture the search result message and write it back to the table.

Can someone please help?

Thanks,
george.d.annumziata@chase.com
 
You need to look at using the Find method to capture each of the possible results you are looking for. Assign the result to a variable name, and write the variable contents to your table.



Cheers,
Dave

"Yes, I'll stop finding bugs in the software - as soon as you stop writing bugs into the software." <-- Me

For all your testing needs: Forum1393
 
Thanks Dave. My skills with QTP extend little past recording a macro of my live actions, so I'll need some additional direction on the Find method mentioned above.I'm sure the script I define above could be completed in less than 5 minutes by someone who knows what they're doing. I would gladly accept the charity if someone wants to take a shot at it.

Thanks

George.D.Annunziata@Chase.com
 
QTP code is based on VBScript.

You can check out the Find method through recording as well. Record the use of the Find (CTRL-F) option being used in IE and check the generated script.

Failing that, you can make use of the Help section to get examples of use of the FIND method. The Object Map in QTP will have given the webpage object a name. The syntax is sonething like :

searchmsg1 = webpagename.Find("Your Text Here)"

which will allow you to assign the found text to searchmsg1. Repeat for the options you expect to use and then pass whichever option is populated back to your table.

Please note, that the syntax displayed above is quite possibly incorrect as I don't have QTP installed to work with here. Check the Help screens for the correct syntax.

Cheers,
Dave

"Yes, I'll stop finding bugs in the software - as soon as you stop writing bugs into the software." <-- Me

For all your testing needs: Forum1393
 
Thanks again Dave. If I right-chick on the text I wish to capture, QTP does recognize it as a web element and allows me to reference it in the script. I think my problem is that QTP is not recognizing it as a table & therefore does not give me to option output the value.
 
Once you have captured it, assign its value to a variable of your own choice.

Then output your variable to your table.

Cheers,
Dave

"Yes, I'll stop finding bugs in the software - as soon as you stop writing bugs into the software." <-- Me

For all your testing needs: Forum1393
 

Hi gdafsu,

I have used the find method before..Maybe you can use it but I have never used it before. Did you have any luck with this method?

My suggestions:

- Try to spy on the results and use the appropriate properties to recognize the objects.

- Most of the time, you will need to use the text property of the object. To retrieve the text property, you will need to use GetRoProperty method.

example:

Value = Browser("name:=.*").Title("name:=*").WebTable("..").GetRoProperty("text")

The 'value' will then hold the result.

once you have the result, to output it to the global sheet of your datatable, you need to do the following:

DataTable("name_of_ur_filed",dtGloblaSheet) = value


Hope this helps,

Otherwise, I did have a look at the site but unfortunaly, I can't do searches as I dont have a valid registration number.

thx,
kev

 
Thanks for all the help. The short story is that my script worked from the get-go, but I didn't realize it. I expected the data table within QTP to display the values I was outputing. The output values were getting stored in the result file defined prior to the run, but I didn't know it.

Sorry for the false alarm
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top