Results 1 to 2 of 2
  1. #1

    QTP: Check or Uncheck CheckBox for Web Page

    I would like to share this function.

    This function will Check or Uncheck the CheckBox on the web page.

    It takes three parameters.

    oObj: object name. Such as: Browser(xxx).Page(xxx)

    sSelectCheckBox: Which CheckBox to select.

    Such as: '"All" meaning it will check all the check box on the page.

    'This will check second CheckBox

    'This will Uncheck Fourth CheckBox

    'This will Uncheck All the CheckBox

    OnOff: '"ON" will Check and "Off" will Uncheck

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">Function SelectCheckBox(oObj,sSelectCheckBox,OnOff)

    Set oDesc = Description.Create()
    oDesc(&quot;micclass&quot.Value = &quot;WebCheckBox&quot;
    Set Lists = oObj.ChildObjects(oDesc)
    NumberOfLists = Lists.Count()
    if sSelectCheckBox = &quot;All&quot; then
    For i = 0 To NumberOfLists - 1
    Lists(i).Set OnOff
    Lists(sSelectCheckBox).Set OnOff
    End if

    End Function</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">

    [ 01-09-2006, 06:32 AM: Message edited by: ppat7046 ]
    Prashant Patel

  2. #2

    Re: QTP: Check or Uncheck CheckBox for Web Page

    Thanx for sharing man, looks good.
    "I realize it's an error, but no one is going to try to do that!"
    From "Top 10 Stupid Comments from Developers".



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 07:34 PM.

Copyright BetaSoft Inc.