Create a function as showed below.
function WebButtonClick(param_BrowserName, param_name, IndexNumb)
Set BrowserName=
Browser("name:="¶m_BrowserName&".*").Page("title:="¶m_BrowserName&".*")
Set NewButton = Description.Create()
NewButton("html tag").value = "A"
NewButton("text").value =param_name
NewButton("index").value =IndexNumb
If BrowserName.WebElement(NewButton).exist Then
BrowserName.WebElement(NewButton).click
Reporter.ReportEvent 0, "Button", "Button clicked"
else
Reporter.ReportEvent 1, "Button", "Button Not found"
End If
end Function
from QTP window you can exceute the function
msgbox WebButtonClick("GooglePage", "More Options", "0")
Hope you got..
Happ scripting :)
On 6/3/13, Venkat Kandula <[email protected]> wrote:
>
> Hello Friends,
>
> How to create Generic Functions for Web Button, Web Link and Web Element,
> its useful for any web application. Please share the code if you have..
>
> Thanks,
> Venkat
>
> --
> --
> 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.
>
>
>
--
With Regards
Srinivas P
Contact Numbers
0091-9849466927 (Mobile Hyderabad)
0091-40-24060750 (Resi)
--
--
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.