QTP -Testcomplete-Testing-Loadrunner-Selenium-Blog

TESTPARTNER BASICS -TUTORIAL

Posted in TESTPARTNER by Sandy runner on January 27, 2010

What is Test partner.

TestPartner is an automated testing tool that accelerates the functional testing of complex applications developed with Microsoft, Java, Web, SAP, Oracle and many other distributed technologies. With TestPartner, you can record user sessions with your applications to create tests, enhance the test by adding validation and test logic, and play back tests to ensure that the applications work as expected.

FROM THE BELOW SCRIPT ONE CAN LEARN HOW TO SCRIPT IN TESTPARTNER
Understand the logic of the script It will help you give a overall idea about Test partner Scripting.


Public objInternet As New InternetExplorer
Sub Main()

'***********************************************************************************************************
'LAUNCH THE BROWSER
objInternet.Visible = True
'objInternet.TheaterMode = True
WAIT415
objInternet.Navigate "http://xf/applicationinterface"

'***********************************************************************************************************

'LOGIN  WITH USER CREDENTIALS
IEWindow("Application=EXPLORER.EXE Caption='Busin*'").Attach
HTMLFrame("Name=home").Attach
HTMLEditBox("Name=username").SetText "Administrator"
WAIT415
HTMLButton("Caption='Log On'").Click
WAIT415

'***********************************************************************************************************
 '"FOLLOWING CODE WOULD HELP YOU UNDERSTAND HOW TO USE CHILDOBJECTS METHOD AND CLICKING ON A PARTICULAR LINK"

'Click on Server Link
Set obj = HTMLFrame("Name=innerContent")

For Each i In obj.Children
If i.TypeName = "HTMLAnchor" Then
If i.Caption = "Servers" Then
i.Click
End If
End If
Next

'***********************************************************************************************************

' "FOLLOWING CODE WOULD HELP YOU UNDERSTAND HOW TO USE TABLE OBJECT & RETRIEVE VALUES FORM THE TABLE"

'Check to see All the Servers are up

IEWindow("Application=EXPLORER.EXE Caption='Busines*'").Attach
Set table = HTMLTable("ID=UniversalRepositoryExplorer_listMainTable")
HTMLFrame("Name=innerContent").Attach
HTMLTable("ID=Explorer").Attach
HTMLDiv("ID=ureDiv").Attach
HTMLTable("ID=UniversalRepositoryExplorer_listMainTable").Attach
For i = 2 To HTMLTable.RowCount
If Trim(HTMLTable.GetCellText(i, 3)) = "Running" And Trim(HTMLTable.GetCellText(i, 4)) = "Enabled" Then
UserCheck "Following Server are working", True, "Server name" & HTMLTable.GetCellText(i, 2) & "<-->Server State" & HTMLTable.GetCellText(i, 3) & "<-->Server Enabled or not" & HTMLTable.GetCellText(i, 4)
Else
UserCheck "Following servers are down", False, "Server name" & HTMLTable.GetCellText(i, 2) & "<-->Server State" & HTMLTable.GetCellText(i, 3) & "<-->Server Enabled or not" & HTMLTable.GetCellText(i, 4)
End If
Next

'***********************************************************************************************************

'Logout and Close the Browser
HTMLBrowser("Caption=' Console'").Attach
HTMLAnchor("Caption='Log Out'").Click
objInternet.Quit
End Sub

Private Sub WAIT415()
If objInternet.Busy = True Then
Sleep 5
Else
End If
End Sub

Advertisements

One Response

Subscribe to comments with RSS.

  1. G.RamaKrishna said, on August 14, 2010 at 7:47 am

    Thank you friend.

    Ya sure i am always ready for the knowledge sharing.

    I also expecting the nsame from you.

    Very good response from you.Take care and please keep in touch with me through my mail.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: