I had tested this code here: http://www.javascripter.net/faq/disablin.htm
with the following exact steps:
Set oRadioGroup =
Browser("title:=Disabling.*").Page("micclass:=Page").WebRadioGroup("name:=r1",
"location:=1").Object.parentNode
For Each oRadio in oRadioGroup
Print "Value: " & oRadio.Value
Print "Selected: " & oRadio.Checked
Print "IsDisabled: " & oRadio.Disabled
Next
Set oRadioGroup = Nothing
Guess, it doesn't work in all scenarios. That means, more R&D. :)
Also, your statement about parentNode is incorrect. It CAN return an
array of childNodes. Secondly, your DOM code will not retrieve the
status of EACH radio button; instead, it will only retrieve the
initial status or the status of the checked button. Same case for your
QTP code.
On Apr 23, 3:24 am, "sh.varma" <[email protected]> wrote:
> Hi,
>
> parentNode Property retrieves the parent object in the document
> hierarchy, it will not return collection obect.
> For reference,http://msdn.microsoft.com/en-us/library/ms535838.aspx
> If we use 'For Each ... in ... Next' statement we will get a error
> message as, 'Object not a collection'.
>
> ' Using Run-time Object Properties
> Val = Browser("").Page("").WebRadioGroup("").Object.Value
> Chk = Browser("").Page("").WebRadioGroup("").Object.Checked
> Dis = Browser("").Page("").WebRadioGroup("").Object.Disabled
>
> ' Using Test Object Properties during run time
> Val = Browser("").Page("").WebRadioGroup("").GetROProperty("value")
> Chk = Browser("").Page("").WebRadioGroup("").GetROProperty("checked")
> Dis = Browser("").Page("").WebRadioGroup("").GetROProperty("disabled")
> Ind = Browser("").Page("").WebRadioGroup("").GetROProperty("selected
> item index")
>
> Regards,
> Varma
>
> On Apr 22, 10:40 pm, Anshoo Arora <[email protected]> wrote:
>
>
>
> > Try this:
>
> > Set oRadioGroup =
> > Browser("").Page("").WebRadioGroup("").Object.parentNode
>
> > For Each oRadio in oRadioGroup
> > Print "Value: " & oRadio.Value
> > Print "Selected: " & oRadio.Checked
> > Print "IsDisabled: " & oRadio.Disabled
> > Next
>
> > Set oRadioGroup = Nothing
>
> > Remember to include the correct properties for all test objects.
>
> > --
> > 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
> > athttp://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
> athttp://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