SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Nov 2011
    Posts
    53
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Unable to identify chkboxes after long execution

    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
    .................................................. ...
    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").Chil dObjects(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("checke d")
    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.

  2. #2
    Advanced Member
    Join Date
    Aug 2006
    Location
    Other side of the Computer
    Posts
    598
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Unable to identify chkboxes after long execution

    Use the DOM approach.
    <font class="small">Code:</font><hr /><pre>
    Set allcheckboxes=Browser("Browser").Page("Page").Obje ct.GetElementsByTagName("INPUT")

    for i = 0 to allcheckboxes.length - 1
    If allcheckboxes(i).type = "checkbox" Then
    checkboxcount = checkboxcount + 1
    If allcheckboxes(i).defaultChecked Then
    checkedCount = checkedCount + 1
    End If

    End If
    next

    msgbox "Total Checkbox: " &amp; checkboxcount &amp; VbCR &amp; "Total Checked: " &amp; checkedCount

    </pre><hr />
    ===========================================

  3. #3
    Member
    Join Date
    Nov 2011
    Posts
    53
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Unable to identify chkboxes after long execution

    Hi EAGLES,

    Thanx for your quick reply.

    I don't have much knowledge on DOM.
    your's code count the check boxes in page successfully,but after then how will i 'ON' the check boxes with using DOM.

    Thanx once again for your help.

    Regards,
    Mahendra.

  4. #4
    Member
    Join Date
    Mar 2008
    Posts
    58
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Unable to identify chkboxes after long execution

    Check if the Check box has HTML ID. If yes then DOM should be as straight forward as this.

    Set objChk = Browser().Page().Object.GetElementById("HTML ID of the check box goes here")

    Browser().Page().CheckBox("source_Index" := objChk.sourceIndex).Set "ON"

  5. #5
    Advanced Member
    Join Date
    Aug 2006
    Location
    Other side of the Computer
    Posts
    598
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Unable to identify chkboxes after long execution

    you can do following"

    allcheckboxes(i).Click

    If it is already clicked then

    If Not allcheckboxes(i).defaultChecked Then allcheckboxes(i).Click
    ===========================================

  6. #6
    Member
    Join Date
    Nov 2011
    Posts
    53
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Unable to identify chkboxes after long execution

    Hi,

    Thank you EAGLES,Shailesh.

    Dom code is working fastly compare to my script.

    But the issue is after clicking the chkboxes on some pages the application is going to hang,it means after selecting all chkboxes in one page i want to click on save and go to next page but if i click on that save button its not saving and the next pages also not opening.

    It's very strange for me.

    Any one help me on this plz.

    Regards,
    Mahendra

  7. #7
    Member
    Join Date
    Nov 2011
    Posts
    53
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Unable to identify chkboxes after long execution

    Hi,

    Anyone help me on this please.

    I am disable the 'BHO Manager class' add-on in IE.
    if i Enable this addon the application crashes and it shows 'visual c++ runtime library error'
    if i disable this addon application is not crashes but the application is hang in middle of script execution.

    what may be the reason?
    is there any way to handle this.
    plz help me.

    Regards,
    mahendra

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 11:58 PM.

Copyright BetaSoft Inc.