10-16-2009, 09:37 AM
Hi everyone,
I am a new person using QTP to develop test script. I am writing the test script to verify adding some products with different options to a cart of web application. I wonder how to identify dynamic options of these products in run time. I used datatable with the column "ProductID" which is described as inputted parameter. It means that I only input the static Product ID from the datatable to "Search" field of web page and I want to execute the script to automatically select an option item in each group from the specified Product ID (not to select a specified option as below and I also don't want to input static options into datatable) then add it to the cart. Please help me find a way to solve it.
Here are some recorded scripts when using the Record functionality:
Many thanks to quick reply for this case.
BR
I am a new person using QTP to develop test script. I am writing the test script to verify adding some products with different options to a cart of web application. I wonder how to identify dynamic options of these products in run time. I used datatable with the column "ProductID" which is described as inputted parameter. It means that I only input the static Product ID from the datatable to "Search" field of web page and I want to execute the script to automatically select an option item in each group from the specified Product ID (not to select a specified option as below and I also don't want to input static options into datatable) then add it to the cart. Please help me find a way to solve it.
Here are some recorded scripts when using the Record functionality:
Code:
Browser("IE").Page("Shopping site").WebEdit("keywords").Set DataTable("ProductID", dtGlobalSheet)
Browser("IE").Page("Shopping site").Image("find our site").Click 8,5
Browser("IE").Page("Product").WebEdit("qty").Set "3"
'it means that I select the option item 1 from option group 1 "id[MGP915]"
Browser("IE").Page("Product").WebList("id[MGP915]").Select "Amber Color"
'it means that I select the option item 2 from option group 2 "id[MGP899]"
Browser("IE").Page("Product").WebRadioGroup("id[MGP899]").Select "OPT3522"
Browser("IE").Page("Product").Image("In Cart").Click 91,12
Browser("IE").Page("Product").Sync
Browser("IE").Close
'end script.
Many thanks to quick reply for this case.
BR