Hello Yesis,
Please follow the below steps, so that your problem will be resolved.
1. Set Obj = oChild(0).ChildItem(i,2,"WebElement",0)
Obj.Click ' this is not correct
use
oChild(0).ChildItem(i,3,"WebElement",0).click
As per the syntax this line of code is correct. Before that first you need
check which table it is considering. for that use the below code to
highligh the tabe
oChild(0).Highlight
After getting exact table, check whether row, 2nd column is having a
webelement. You can check this by using table checkpoint(F12). If every
thing is fine the below code will work.
'============================================================
Set oDesc = Description.Create()
oDesc("html id").value ="ViewTable"
oDesc("html tag").Value = "TABLE"
Set oChild = Browser("User").Page("BGC
User").Frame("PWGadget2Ifr").ChildObjects(oDesc)
row = oChild(0).RowCount
oChild(0).Highlight
For i = 1 to row
val = oChild(0).getCellData(i,2)
If trim(val)=trim("Test Test") Then
oChild(0).ChildItem(i,2,"WebElement",0).Click
End if
Next
Set oChild = Nothing
Set oDesc = Nothing
Regards
Uma Mahesh
8939192903
On Mon, Jul 15, 2013 at 5:48 PM, Akhalesh Yadav <[email protected]
> wrote:
> Use row = oChild.RowCount instaed of oChild(0)
>
>
> Thanks...
> Akhalesh
>
>
> On Mon, Jul 15, 2013 at 4:45 PM, Ta Se <[email protected]> wrote:
>
>> Hi all,
>>
>> I have got exception Object Required "obj" in below script, anyone could
>> you help me.... thanks a lot !!
>>
>> Set oDesc = Description.Create()
>> oDesc("html id").value ="ViewTable"
>> oDesc("html tag").Value = "TABLE"
>>
>> Set oChild = Browser("User").Page("BGC
>> User").Frame("PWGadget2Ifr").ChildObjects(oDesc)
>> row = oChild(0).RowCount
>>
>> For i = 1 to row
>> val = oChild(0).getCellData(i,2)
>>
>> If trim(val)=trim("Test Test") Then
>> Set Obj = oChild(0).ChildItem(i,2,"WebElement",0)
>> Obj.Click
>> End if
>> Next
>>
>> Set oChild = Nothing
>> Set oDesc = Nothing
>>
>> --
>> --
>> 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.
>>
>>
>>
>
>
>
> --
> Akhalesh yadav
> +919555717928
> +919310680659
>
> --
> --
> 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.
>
>
>
--
--
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.