Micro Focus QTP (UFT) Forums
How to change the combobox value for each iteration - 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 change the combobox value for each iteration (/Thread-How-to-change-the-combobox-value-for-each-iteration)



How to change the combobox value for each iteration - rajaselvan.d - 01-23-2008

When same test repeated at the time combobox data should change, What should i do?
Pls give the sample script.


RE: How to change the combobox value for each iteration - Rajashekar Gouda - 01-23-2008

Pass the data u want to test from our to DataTable and use the For loop to remeat the scripts

sample code

Code:
Dim br,url,num,i
br = "C:\Program Files\Internet Explorer\iexplore.exe"
url = "www.google,com"

On error resume next
systemutil.Run br,url,"","open",3

If err.number <> 0  Then
    Reporter.ReportEvent 1,"Failed","The Browser and url has not been invoked"
    exitrun(0)
    else
    Reporter.ReportEvent 0,"Passed","The application has been invoked successfully"
End If

Datatable.ImportSheet "path,"ddd","ddd"
num=datatable.GetSheet ("ddd").Getrowcount
msgbox (num)
For i=1 to num
DataTable.GetSheet("ddd").SetCurrentrow i
Browser("name:=df"page("title:=dfs").WebEdit("html id:=fsfse").Set datatable("dfsvd",dtLocalSheet)
Browser("name:=dfefs").page("title:=dfsdfs").WebEdit("html id:=fsdf").click
Browser("name:=dfefs").page("title:=dfsdfs").WebEdit("html id:=fsdf")..Set datatable("password",dtLocalSheet)

Browser("name:=dfefs").page("title:=dfsdfs").WebEdit("html id:=fsdf").WebButton("name:=fsdf").click

Next



RE: How to change the combobox value for each iteration - Anees Khan - 02-11-2008

Gouda i have 1 question similar to this Topic...

How do i select different radio buttons for each ietration any code u hav in mind,if yes can u putit across here.
Situation:there are 5 radio buttons in page for each iteration it should select the radio buttons in an order like 1 2,3,..... for 1st iteration,2nd iteration so on...........

plz guide me on this