Micro Focus QTP (UFT) Forums
How to add new row and select next dropdown - 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: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: How to add new row and select next dropdown (/Thread-How-to-add-new-row-and-select-next-dropdown)



How to add new row and select next dropdown - pat_stan - 10-19-2012

Hello,
I would appreciate if someone can guide me in this situation.
I am suppose to add a row and from that list I am suppose to select the first drop-down and then add the next row and select the next drop-down.
Here is my code:
Code:
myframe=Browser("[DEV mode - 7.0.2.29]").Page("[DEV mode - 7.0.2.29]").Frame("top_frame_2").WebList("FNOLWizard:NewClaimWizard_Poli").GetROProperty("all items")
mytotal=Browser("[DEV mode - 7.0.2.29]").Page("[DEV mode - 7.0.2.29]").Frame("top_frame_2").WebList("FNOLWizard:NewClaimWizard_Poli").GetROProperty("items count")
myframearr = split (myframe, ";")

For i=1 to mytotal-1
mycoverag = myframearr(i)

Browser("[DEV mode - 7.0.2.29]").Page("[DEV mode - 7.0.2.29]").Frame("top_frame_18").Link("Add").Click 21,12

Browser("[DEV mode - 7.0.2.29]").Page("[DEV mode - 7.0.2.29]").Frame("top_frame_4").WebList("FNOLWizard:NewClaimWizard_Poli").Select (mycoverag)

Next

The problem is the selected drop-down always goes to the first row and not able to get the 2nd drop-down in the 2nd row.
The only change I see in the property "FNOLWizard:NewClaimWizard_Poli" is the abs_y and y property change between the two drop down position
How can I make these properties dynamic while I run the script?
Thanks
Pat
Pat


RE: How to add new row and select next dropdown - kalaivanan123 - 10-29-2012

Try the Below Code,


Code:
Set objDescription= Description.Create()
objDescription("name").value="FNOLWizard:NewClaimWizard_Poli.*"
Set weblistObjects=Browser("[DEV mode - 7.0.2.29]").Page("[DEV mode - 7.0.2.29]").Frame("top_frame_2").ChildObjects(objDescription)

Spl_myframe=split(myframe,";")
For i=0 to Ubound(Spl_myframe)
mycoverag = Spl_myframe(i)
Browser("[DEV mode - 7.0.2.29]").Page("[DEV mode - 7.0.2.29]").Frame("top_frame_*").Link("Add").Click 21,12
Set weblistObjects=Browser("[DEV mode - 7.0.2.29]").Page("[DEV mode - 7.0.2.29]").Frame("top_frame_2").ChildObjects(objDescription)
weblistObjects(i).Select (mycoverag)
Next



RE: How to add new row and select next dropdown - krr - 10-29-2012

Hi,

Where you want to add another Row? Its not clear.