Interview Questions   Tutorials   Discussions   Programs   Videos   

QTP - Give the real time example for descriptive programming of web application?




296
views
asked marvit September 16, 2014 07:12 AM  

Give the real time example for descriptive programming of web application?


           

1 Answers



 
answered By Dharma   0  

Working with any app

'Click on Link

'Set Text On Edit Box

'Click on Button

‘ Select a list item

Set oPage=Browser("name:=.*").Page("title:=.*")

AnyWebAppTesting oPage,"WebEdit","email","GAReddy"
AnyWebAppTesting oPage,"WebEdit","passwd","GAReddy"
AnyWebAppTesting oPage,"WebButton","Sign In",""

Function AnyWebAppTesting(oPage,ObjectType,ObjectName,TestData)
   Select Case ObjectType
   Case "WebEdit"
   Set oWebEdit=Description.Create()
   oWebEdit("micClass").value="WebEdit"
   oWebEdit("name").value=ObjectName
   oPage.WebEdit(oWebEdit).Set TestData

     Case "WebButton"
   Set oWebButton=Description.Create()
   oWebButton("micClass").value="WebButton"
   oWebButton("name").value=ObjectName
   oPage.WebButton(oWebButton).Click

     Case "Link"
   Set oLink=Description.Create()
   oLink("micClass").value="Link"
   oLink("name").value=ObjectName
   oPage.Link(oLink).Click

   End Select
End Function
flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert