SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Apr 2004
    Location
    bangalore
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    I need to find if the checkbox is enabled or disabled

    Working on javascript

    Attach "Attach name"

    hCtrl = checkboxFind("checkbox name")
    ;Checkbox is enabled in Attach window
    If CtrlEnabled( hCtrl ) = 1
    UserCheck "enabled", 1, "p"
    Else
    UserCheck "enabled", 0, "f"
    Endif

    Checkbox "Checkbox name",'Left SingleClick'
    ;Checkbox is now disabled using the script

    hCtrl = checkboxFind("Checkbox name")
    If CtrlEnabled( hCtrl ) = 1
    UserCheck "disabled", 1, "p"
    Else
    UserCheck "disabled", 0, "f"
    Endif

    But the script says that the contol is checked even though it is unchecked

  2. #2
    Junior Member
    Join Date
    Jan 2002
    Location
    Omaha,NE-68127,U.S.A
    Posts
    21
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: I need to find if the checkbox is enabled or disabled

    Next to the check box static text is not the check box name in the java scripts.

    Use Identify to capture the check box name. You could see attach name in the Identify window. Use that attach name as check box name. That could solve the problem.
    hCtrl = CheckBoxFind("Attach Name of check box")

  3. #3
    Senior Member
    Join Date
    Jun 2002
    Location
    farmington hills, MI, US
    Posts
    713
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: I need to find if the checkbox is enabled or disabled

    The problem is that checkBoxFind returns a unique Windows handle for the check box. HTML controls do no have unique Windows handles your best bet would be to use a form check with extended properties and only look for the checked property. If it passes then the checkbox is checked and if it fails then it is not checked.

    You may also consider changing to TestPartner as you can easily verify this property as follows:

    HTMLCheckBox ("Application=IEXPLORE.EXE Name=disable_smilies").Checked

    The return value is 1 for checked and 0 for not checked.

    TestPartner is able to access objects through the IE DOM and allows you to get at these properties where QARun does not.

 

 

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 07:55 AM.

Copyright BetaSoft Inc.