Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not able to select particular checkbox from mulitple checkboxes
#1
Not Solved
Hi guys,

I am using QTP10 and .NET application.
I am using Descriptive programming.

I have a problem when qtp is trying to select the particular check box from multiple check boxes.
All the check boxes have below mentioned same properties. there is no unique property.
type, HTML tag, calss,outerhtml properties.
there is no unique property like name, html id...

And index value is there. But when we are using the index number during script execution itis selecting wrong checkbox.(here the problem is, suppose in team one resource is executing the qtp scripts, other resource is testing manually and is creating some other check boxes. so, no.of checkboxes are increased.in this situation Index property is not working.)

Sample Code is:

Code:
If Browser("title:=http://172.16.220.24/Proof/PageManager.aspx    ").Page("url:=http://172.16.220.24/Proof/PageManager.aspx").Frame("html tag:=IFRAME","title:=PROOF"). WebCheckBox("html tag:=INPUT","type:=checkbox").Exist Then

msgbox "hi"

End if
Any one know the solution pls reply.

Thanks in advance!
Reply
#2
Not Solved
It will be helpful if u provide us snapshot.
Reply
#3
Not Solved
pls find the attached screenshot.


Attached Files Image(s)
   
Reply
#4
Not Solved
Pls try the below code
Code:
rCount = Browser("").Page("").WebTable("").RowCount

For i = 1 to rCount

    cCount = Browser("").Page("").WebTable("").ColumnCount(i)

    For j = 1 to cCount

        cData = Browser("").Page("").WebTable("").GetCellData(i,j)
        Print cData

        Set cData1 = Browser("").Page("").WebTable("").ChildItem(i,j,"WebCheckbox",0)
        ' ChildItem --  Returns a test object from the cell by type and index.
        
        Act_val  = cData1.GetROProperty
        IF Act_val = “Administrator” THEN
           cData1.SET ON
                END IF
    Next

Next
Reply
#5
Not Solved
I have tried with this code. But it throws an error. Pls Find the attached screenshot.
those checkboxes are available in side the frame. not in webtable.
already i tried with this logic.here it is not working.
any other soluiton pls reply.


Attached Files Image(s)
   
Reply
#6
Not Solved
Object spy the frame and post the screen shot.
Reply
#7
Not Solved
Hi,
I have attached the screenshots. PFA.
By using object spy it is showing object is available in webtable.
But when we recordedit is showing object is vaailble in frame and when we write the descriptive programming with webtable it is not recognising the object.

please find the second attachment.
Hi,

please check the above attachements if u know the solution pls send reply.


Attached Files Image(s)
       
Reply
#8
Not Solved
First try to find whether table highlight and then no. of rows and
post back ur reply

Code:
Browser("").Page("").Frame("").WebTable("").highlight

rCount = Browser("").Page("").Frame("").WebTable("").GetROProperty("rows")
Msgbox rCount
Reply
#9
Not Solved
Code:
Dim obj_check
Dim allcheckboxes
Set obj_check=Description.Create
obj_Check("html tag").value="INPUT"
obj_Check("type").value="checkbox"
Set allcheckboxes=Browser("micclass:=Browser").Page("micclass:=Page").ChildObjects(obj_check)
a= allcheckboxes.count()
For i = 0 to 17
allcheckboxes(i).Set "ON"
Next

here 17 is the value of the count of check boxes in my project. I think it will solve ur problem
Reply
#10
Not Solved
Hi,
I tried but it is not recognising the webTable by using descriptive programing. when I recorded, in the Object repository also there is no webtable .please find the attachment.

When i used webtable it is showing some error message already i have posted that screenshot.pls check that.

Any other solution?


Attached Files Image(s)
   
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with Select checkbox from data table value jayraocourts 0 1,297 11-01-2019, 10:25 PM
Last Post: jayraocourts
Sad Click checkbox using its label name. venkatesh9032 1 3,240 08-10-2015, 10:33 PM
Last Post: kotaramamohana
  Childobject return wrong checkbox count.. VpnQTP 1 2,885 04-09-2015, 09:07 PM
Last Post: babu123
  How to select dynamic checkbox from web dropdown QA_Newbie 2 4,699 07-20-2014, 09:40 PM
Last Post: QA_Newbie
  How To pick up the particular mail in Post Login Gmail page and click on Checkbox akhandesh 0 2,868 12-02-2013, 01:35 PM
Last Post: akhandesh

Forum Jump:


Users browsing this thread: 1 Guest(s)