Micro Focus QTP (UFT) Forums
WebCheckBox - Index problem - 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: WebCheckBox - Index problem (/Thread-WebCheckBox-Index-problem)



WebCheckBox - Index problem - boludes - 01-25-2011

Hello All ! How are you? I hope you are very good.

I have a problem with the "index" identifier in the WebCheckBox element, I'm trying to make something like this:
Code:
Count=Browser("Application RECLID").Page("Application RECLID").WebTable("Code PSV").RowCount

For y=1 to Count

CheckText = Browser("Application RECLID").Page("Application RECLID").WebCheckBox("WebCheckBox").GetTOProperty("Value")
// Here, the changing index code to WebCheckBox with de Count variable.//

Datatable.LocalSheet.AddParameter "Code",CellText

Next
I read about "index" in the help page, but still unclear for my.

Thanks!


RE: WebCheckBox - Index problem - supputuri - 01-25-2011

Hi,

I am not sure about what you want to test.

But if you want to use the index, then you have to set the index value to checkbox in the OR.

Use "SetTOProperty" to change the value in the OR.

Code:
Count=Browser("Application RECLID").Page("Application RECLID").WebTable("Code PSV").RowCount

For y=0 to Count-1
Browser("Application RECLID").Page("Application RECLID").WebCheckBox("WebCheckBox").SetToProperty "index",y
CheckText = Browser("Application RECLID").Page("Application RECLID").WebCheckBox("WebCheckBox").GetTOProperty("Value")

Datatable.LocalSheet.AddParameter "Code",CellText

Next
Please let me know if you need any more informaiton.
Sorry for the code that I shared in the previous reply,please ignore that.

Code:
Count=Browser("Application RECLID").Page("Application RECLID").WebTable("Code PSV").RowCount
DataTable.LocalSheet.AddParameter "Code",""
For y=0 to Count-1
         DataTable.LocalSheet.SetCurrentRow y+1
         Browser("Application RECLID").Page("Application RECLID").WebCheckBox("WebCheckBox").SetToProperty "index",y
         CheckText = Browser("Application RECLID").Page("Application RECLID").WebCheckBox("WebCheckBox").GetTOProperty("Value")
         DataTable("Code", dtlocalSheet)= CheckText
Next

Please let me know if you need any more info.


RE: WebCheckBox - Index problem - boludes - 01-25-2011

Hello supputuri !

Thanks for help me, look, I'm trying to do a list of values about the code in the checkbox, becouse, I need a large code to set "on"the checkbox and it's complicated to write one by one.

The code doesn't works, only 1 code is replicated 21 times in the table.

I don't know how can I get the 21 codes from the checkboxs