if you want for one checkbox then create function and just pass the
parameter val as a,b,c,d as required.
Function ClickCheckBox(ChkName)
Browser("Micclass:=Browser").Page("Micclass:=Page").Checkbox("name:=" &
ChkName & """).Set "ON"
End Function
Call ClickCheckBox("a")
Call ClickCheckBox("b")
Call ClickCheckBox("c")
Call ClickCheckBox("d")
-Shirish
On Thu, Jan 20, 2011 at 6:20 PM, raghu busireddy
<[email protected]>wrote:
> no need to create object for every element
>
> if it is one checkbox one object is required.that is use of descriptive
> programing
>
>
> On Thu, Jan 20, 2011 at 6:13 PM, ta se <[email protected]> wrote:
>
>> Thanks for your quick response.
>>
>> Could you please confirm, if i going to use more than one text box and
>> buttons. We have to create object for every element ? or do we have any
>> other way write ?
>>
>> Regards,
>> Tamilselvan
>>
>>
>> On Thu, Jan 20, 2011 at 5:08 PM, raghu busireddy <
>> [email protected]> wrote:
>>
>>> hi Tamilselvan
>>>
>>> u can use this code
>>>
>>> Set a = Description.Create
>>> a("micclass").value="WebCheckBox
>>> Set
>>> basepage=Browser("Micclass:=Browser").Page("Micclass:=Page").).ChildObjects(a)
>>> for i=0 to basepage.count
>>> basepage(i).set "ON"
>>> next
>>>
>>>
>>> if use the above code it will check all the cheek boxes in the page.
>>>
>>> reply me
>>> raghu
>>>
>>>
>>>
>>> On Thu, Jan 20, 2011 at 12:30 PM, ta se <[email protected]> wrote:
>>>
>>>> Hi All,
>>>>
>>>> Anyone could you please guide me, how to reduce the code(single line or
>>>> two lines).
>>>>
>>>> Here, i am using 4 lines to create, assign and implement a same object,
>>>> is any other way to reduce the code ? Please share me your knowledge.
>>>> Thanks
>>>> in advance.
>>>>
>>>> Set a = Description.Create
>>>> Set b = Description.Create
>>>> Set c = Description.Create
>>>> Set d = Description.Create
>>>>
>>>> a("micclass").value="WebCheckBox"
>>>> b("micclass").value="WebCheckBox"
>>>> c("micclass").value="WebCheckBox"
>>>> d("micclass").value="WebCheckBox"
>>>>
>>>> Set
>>>> basepage=Browser("Micclass:=Browser").Page("Micclass:=Page").Checkbox("name:=a").set
>>>> "on"
>>>> Set
>>>> basepage=Browser("Micclass:=Browser").Page("Micclass:=Page").Checkbox("name:=b").set
>>>> "on"
>>>> Set
>>>> basepage=Browser("Micclass:=Browser").Page("Micclass:=Page").Checkbox("name:=c").set
>>>> "on"
>>>> Set
>>>> basepage=Browser("Micclass:=Browser").Page("Micclass:=Page").Checkbox("name:=d").set
>>>> "on"
>>>>
>>>> Regards,
>>>> Tamilselvan
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> "QTP - HP Quick Test Professional - Automated Software Testing"
>>>> group.
>>>> To post to this group, send email to [email protected]
>>>> To unsubscribe from this group, send email to
>>>> [email protected]<mercuryqtp%[email protected]>
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/MercuryQTP?hl=en
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> "QTP - HP Quick Test Professional - Automated Software Testing"
>>> group.
>>> To post to this group, send email to [email protected]
>>> To unsubscribe from this group, send email to
>>> [email protected]<mercuryqtp%[email protected]>
>>> For more options, visit this group at
>>> http://groups.google.com/group/MercuryQTP?hl=en
>>
>>
>> --
>> You received this message because you are subscribed to the Google
>> "QTP - HP Quick Test Professional - Automated Software Testing"
>> group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]<mercuryqtp%[email protected]>
>> For more options, visit this group at
>> http://groups.google.com/group/MercuryQTP?hl=en
>>
>
> --
> You received this message because you are subscribed to the Google
> "QTP - HP Quick Test Professional - Automated Software Testing"
> group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<mercuryqtp%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/MercuryQTP?hl=en
>
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en