Hi,
This Code will help u
Suppose the text is in 5th Column with Link
Text = "QTP"
'Get the Row Count of the WebTable
Rc=Browser(XX).Page(XX).WebTable(XX).RowCount
'Start the iteration from row 2 coz the 1st row contains header part
For i =2 to Rc
If Browser(XX).Page(XX).WebTable(XX).GetCellData(i,5) = Text Then
Browser(XX).Page(XX).WebTable(XX).ChildItem(i,5,"Link",0).Click
End If
Exit For
Next
Hope this code helps you
On Tue, Aug 23, 2011 at 11:29 AM, gopi nath <[email protected]> wrote:
>
> I hope, those two objs Text and the link would exist in a WebTable
> Case 1:
> If the link is dynamic then you can use the .ChildItem method to solve your
> issue.
>
> rw=Browser(XX).Page(XX).WebTable(XX).GetRowCount
> cl=rw=Browser(XX).Page(XX).WebTable(XX).GetcolumnCount
> For i =1 to rw
> For j=1 to cl
> If Browser(XX).Page(XX).WebTable(XX).GetCellData(i,j)=Text Then
> Browser(XX).Page(XX).WebTable(XX).ChildItem(i,j,"Link",0).Click
> End If
> Next
> Next
>
>
> Case 2: If the Link is static
> Browser(XX).Page(XX).Link(XX).Click
>
>
>
>
>
>
> On Mon, Aug 22, 2011 at 5:54 AM, Blessy <[email protected]> wrote:
>
>>
>>
>>
>> Hi,
>>
>> How can I tell qtp to click a link beside a particular text.Please let me
>> know the script code.
>> Thanks.
>>
>> --
>> 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
> "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
"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