Quality Testing

Quality is delighting customers

Hi All,

I need to click the link test in the table

HTML Code:

<table border="1">
<tbody><tr>
<td>Value 1</td>
<td><a href="one">test</a></td>
</tr>
<tr>
<td>Value 2</td>
<td><a href="two">test2</a></td>
</tr>
</tbody>
</table>

QTP code:
set one=Browser("Browser").Page("Page").WebTable("Value
1").ChildItem(0,1,"Link",0)
one.click

When i record the above operation
Browser("Browser").Page("Page").Link("test").Click

My Doubt is why  link does't appears as child element of webtable.

Thanks
sankar.

Views: 70

Reply to This

Replies to This Discussion

Dear sankar,

we can achieve or target in so many ways..
You achieved in Scripting way..
But you can try just DP way itself like below..
Browser("title:=Browser").Page("title:=Page").link("name:=Value1").click


But advantage of your scripting,
when you have many links with same name, you need to diff. by it's position then we will simply go as this way. like link will be arranged in the form of Web Table.
so get the child Items in specified cell.
if it has more links also by index of the link you will filter it and it will return the one unique link reference.
Hi Saravanan,

Thanks for your reply it solves my problem

Thanks
sankar
Hi Saravanan,
I need one solution -

msgbox " hello india "
I have written this line in notepad and save it hello.vbs
How I call or run this file in QTP ?
pl reply me with example soon.
Thanks
Hitesh Shah
Noida
Dear Hitesh Shah,

try executefile command,

Syntax is,
executefile "Filepath"

Example:
executefile "C:\hi.vbs"
Hi Hitesh,

Do one thing, in the .vbs file you write the logic or your requirment in Function , as shown below.

Function functionname

logic

End Funnction

Now, 2 nd step : you have to load this .vbs file in file-settings-Run-attach this .vbs or browse it.


Now, in the action in which you w\have browse the file, , in this action just call the function ( Call Functionname) name and run it or if you want to see step by step press f11-enter-go on press f11, step by step for debugging.

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2021   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service