Micro Focus QTP (UFT) Forums
Unable to identify chckboxes after long execution - 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 Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: Unable to identify chckboxes after long execution (/Thread-Unable-to-identify-chckboxes-after-long-execution)



Unable to identify chckboxes after long execution - mahendra - 01-19-2012

Hi,

In my application,36 webelements are there if i click each webelement it shows some check boxes and i want to 'ON' those check boxes.
but the thing is after running the script 30 to 40 min,it fails to count the chkboxes,it shows the count as 0.if i close the application and run again then it counts correctly.

Am using the below code
.....................................................
Code:
Dim obj_check,allcheckboxes
Set obj_check=Description.Create
obj_Check("html tag").value="INPUT"
obj_Check("type").value="checkbox"
Set allcheckboxes=Browser("Browser").Page("Page").ChildObjects(obj_check)
chkboxCount= allcheckboxes.count()
'MsgBox chkboxCount

For m=0 to chkboxCount-1
If  Browser("Browser").Page("Page").WebCheckBox("html tag:=INPUT","index:="&m).Exist(15) Then
CboxCheck= Browser("Browser").Page("Page").WebCheckBox("html tag:=INPUT","index:="&m).GetROProperty("checked")
If CboxCheck=0 Then
Browser("Browser").Page("Page").WebCheckBox("html tag:=INPUT","index:="&m).Set "ON"
Browser("Browser").Page("Page").Sync
End If
End If                                                
Next    
Browser("Browser").Page("Page").Image("CTRL_Save").Click
.......................................................
iam using,
QTP 9.2
IE-7
TIBCO UI,java application.


Any one help me one this please.

Regards,
Mahendra.


RE: Unable to identify chckboxes after long execution - anil2u - 01-20-2012

One question.. Are you using the above code as a function or procedure and calling it each time when you click the webelement to check the boxes? If yes try setting the allcheckboxes to nothing before leaving the procedure or function.

Let me know if this works

Thanks


RE: Unable to identify chckboxes after long execution - mahendra - 01-21-2012

Hi anil,
iam taking the webelements in array and using for loop i click on each element and click on chkboxes for eachelement and go to next webelement.
i think it may be database issue,because in one page 200 chkboxes are there,for that page its working fine but in another page it have 300,the app hang at there