Set d=description.Create
d("micclass").value="WebElement"
d("html id").value="currentDisplayMSRP"
Set obj=browser("title:=.*").page("title:=.*").childobjects(d)
msgbox obj.count
msgbox obj(0).getroproperty("innertext")
But when i create a function it doesn't show the value
Function Text_Check1(fText)
i=0
Set myp=Browser("title:=.*").page("title:=.*")
Set myo=description.Create()
myo("micclass").value="WebElement"
myo("html id").value=fText
Set oDC=myp.Childobjects(myo)
See if it recognizes the same,or else change the array value
oDC(0).Highlight
Print oDC(0).GetRoProperty("innertext")
set myp= nothing
set myo= nothing
Set Odc=Nothing
End Function
Text_Check1 "currentDisplayMSRP"
On Sun, Sep 8, 2013 at 7:13 AM, Pavan Turlapati <[email protected]>wrote:
> Hi,
> Can you try if the below works:
>
> Public Function Text_Check1(fText)
> Dim i,myp,myo,obj
> i=0
> Set myp=Browser("title:=.*").page("title:=.*")
> Set myo=description.Create()
> myo("micclass").value="WebElement"
> myo("html id").value=Trim(fText)
> myo("index").value=i
> Set obj=myp.childobjects(myo)
> If obj.count>0 Then
> Text_Check1=obj(0).getRoProperty("innertext")
> Exit Function
> Else
> Text_Check1="Nothing"
> Exit Function
> End If
> End Function
>
>
> myvar=Text_Check1 "currentDisplayMSRP"
> Print myvar
>
>
>
>
>
> On Friday, September 6, 2013 10:41:51 PM UTC-5, Wajahat Awan wrote:
>>
>> I wanted to getroproperty of an object using function
>> when i use descriptive it works fine:
>>
>> Set d=description.Create
>> d("micclass").value="**WebElement"
>> d("html id").value="**currentDisplayMSRP"
>> Set obj=browser("title:=.*").page(**"title:=.*").childobjects(d)
>> msgbox obj.count
>> msgbox obj(0).getroproperty("**innertext")
>>
>> But when i create a function it doesn't show the value
>> Function Text_Check1(fText)
>> i=0
>> Set myp=Browser("title:=.*").page(**"title:=.*")
>> Set myo=description.Create()
>> myo("micclass").value="**WebElement"
>> myo("html idt").value=fText
>> myo("index").value=i
>> print myp.WebElement(myo).**GetROProperty("innertext")
>>
>> set myp= nothing
>> set myo= nothing
>>
>> End Function
>> Text_Check1 "currentDisplayMSRP"
>>
> --
> --
> 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
>
> ---
> You received this message because you are subscribed to the Google Groups
> "QTP - HP Quick Test Professional - Automated Software Testing" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
Regards,
Sourish Mallick
--
--
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
---
You received this message because you are subscribed to the Google Groups "QTP
- HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.