Web Application Testing

Automation Framework for Web Applications

Application: Online Shopping Portal
Application Type: Internet Application (Public)

Domain: ECommerce

Sub-Domain: B2C (Business to Customer)

Application Environment: LAMP (Linux, Apache, MySQL, PHP)

HTML and Activex controls for UI Design

Add ins
---------
Activex
Web
---------------------
It has 2 interfaces:

a) Client side interface

URL:

www.gcrit.com/build3

b) Admin Interface:

www.gcrit.com/build3/admin

User id: admin

Password: admin@123
---------------------------------
Features in Admin Interface:

1) Create / Edit / Delete Categories and Products

2) Create / Edit / Delete Vendors

3) Edit / Delete Reviews

4) Edit / delete Customers

5) Create / Edit / Delete Currencies and set default currency

6) Edit / Delete Orders

7) Reports
    Products viewed
    Products purchased etc...
---------------------------------------------
Features in Client / User interface

1) Customer Registration

2) Login

3) Shopping and Check out

etc...
--------------------------------------
Stake holders
---------------
i) Vendors
(They place products, and maintain stock and ship products with the help of distributors)

ii) Portal Owners

iii) Customers
(View products, Purchase products, Enquiries etc...)

iv) Payment Gateways
(Collecting payments from customers and sending to vendors, refunds etc...)

v) Courier service Providers
(Shipping products from vendor to customers, replacements etc...)
--------------------------------
User Defined Functions for Gcr Shop web Application:
'**************************************
'    Launch Application
'**************************************
Function Launch_App()
SystemUtil.Run "C:\Program Files\Internet Explorer\iexplore.exe", "http://www.gcrit.com/build3/"
Wait 5
Browser_Name = Browser("GCR Shop").GetROProperty("title")

If Browser_Name = "GCR Shop" Then
    Launch_App = "Application Launched - Passed"
    Else
    Launch_App = "Application Not Launched - Failed"
End If
Msgbox Launch_App
End Function
'**************************************
'    Customer Registration
'**************************************
Function Register(Email, Password)
Browser("GCR Shop").Page("GCR Shop").Link("create an account").Click @@ hightlight id_;_Browser("GCR Shop").Page("GCR Shop").Link("create an account")_;_script infofile_;_ZIP::ssf1.xml_;_
Browser("GCR Shop").Page("GCR Shop_2").WebRadioGroup("gender").Select "m" @@ hightlight id_;_Browser("GCR Shop").Page("GCR Shop 2").WebRadioGroup("gender")_;_script infofile_;_ZIP::ssf2.xml_;_
Browser("GCR Shop").Page("GCR Shop_2").WebEdit("firstname").Set "abcd xyz" @@ hightlight id_;_Browser("GCR Shop").Page("GCR Shop 2").WebEdit("firstname")_;_script infofile_;_ZIP::ssf3.xml_;_
Browser("GCR Shop").Page("GCR Shop_2").WebEdit("lastname").Set "rtettyyy" @@ hightlight id_;_Browser("GCR Shop").Page("GCR Shop 2").WebEdit("lastname")_;_script infofile_;_ZIP::ssf4.xml_;_
Browser("GCR Shop").Page("GCR Shop_4").WebEdit("dob").Set "09/11/1977"
Browser("GCR Shop").Page("GCR Shop_2").WebEdit("email_address").Set Email @@ hightlight id_;_Browser("GCR Shop").Page("GCR Shop 2").WebEdit("email address")_;_script infofile_;_ZIP::ssf9.xml_;_
Browser("GCR Shop").Page("GCR Shop_2").WebEdit("company").Set "asdf" @@ hightlight id_;_Browser("GCR Shop").Page("GCR Shop 2").WebEdit("company")_;_script infofile_;_ZIP::ssf10.xml_;_
Browser("GCR Shop").Page("GCR Shop_2").WebEdit("street_address").Set "hghgh jjjj" @@ hightlight id_;_Browser("GCR Shop").Page("GCR Shop 2").WebEdit("street address")_;_script infofile_;_ZIP::ssf11.xml_;_
Browser("GCR Shop").Page("GCR Shop_2").WebEdit("postcode").Set "12345" @@ hightlight id_;_Browser("GCR Shop").Page("GCR Shop 2").WebEdit("postcode")_;_script infofile_;_ZIP::ssf12.xml_;_
Browser("GCR Shop").Page("GCR Shop_2").WebEdit("city").Set "Hyderabad" @@ hightlight id_;_Browser("GCR Shop").Page("GCR Shop 2").WebEdit("city")_;_script infofile_;_ZIP::ssf13.xml_;_
Browser("GCR Shop").Page("GCR Shop_2").WebEdit("state").Set "Telangana" @@ hightlight id_;_Browser("GCR Shop").Page("GCR Shop 2").WebEdit("state")_;_script infofile_;_ZIP::ssf14.xml_;_
Browser("GCR Shop").Page("GCR Shop_2").WebList("country").Select "India" @@ hightlight id_;_Browser("GCR Shop").Page("GCR Shop 2").WebList("country")_;_script infofile_;_ZIP::ssf15.xml_;_
Browser("GCR Shop").Page("GCR Shop_2").WebEdit("telephone").Set "9233454545" @@ hightlight id_;_Browser("GCR Shop").Page("GCR Shop 2").WebEdit("telephone")_;_script infofile_;_ZIP::ssf16.xml_;_
Browser("GCR Shop").Page("GCR Shop_2").WebEdit("password").Set Password @@ hightlight id_;_Browser("GCR Shop").Page("GCR Shop 2").WebEdit("password")_;_script infofile_;_ZIP::ssf17.xml_;_
Browser("GCR Shop").Page("GCR Shop_2").WebEdit("confirmation").Set Password
Browser("GCR Shop").Page("GCR Shop_2").WebButton("Continue").Click @@ hightlight id_;_Browser("GCR Shop").Page("GCR Shop 2").WebButton("Continue")_;_script infofile_;_ZIP::ssf19.xml_;_
Conformation_Message = Browser("GCR Shop").Page("GCR Shop_3").WebElement("Your Account Has Been").GetROProperty("innertext") @@ hightlight id_;_Browser("GCR Shop").Page("GCR Shop 3").WebElement("Your Account Has Been")_;_script infofile_;_ZIP::ssf20.xml_;_

If Conformation_Message = "Your Account Has Been Created!" Then
Register = "Customer Registration Successful - Passed"
Else
Register = "Customer Registration Unsuccessful - Failed"
End If
Msgbox Register
End Function
'**************************************
'    Login
'**************************************
Function Login(Email, Password)
Browser("GCR Shop").Page("GCR Shop").Link("login").Click @@ hightlight id_;_Browser("GCR Shop").Page("GCR Shop").Link("login")_;_script infofile_;_ZIP::ssf1.xml_;_
Browser("GCR Shop").Page("GCR Shop_2").WebEdit("email_address").Set Email @@ hightlight id_;_Browser("GCR Shop").Page("GCR Shop 2").WebEdit("email address")_;_script infofile_;_ZIP::ssf2.xml_;_
Browser("GCR Shop").Page("GCR Shop_2").WebEdit("password").Set Password
Browser("GCR Shop").Page("GCR Shop_2").WebButton("Sign In").Click @@ hightlight id_;_Browser("GCR Shop").Page("GCR Shop 2").WebButton("Sign In")_;_script infofile_;_ZIP::ssf4.xml_;_
 @@ hightlight id_;_Browser("GCR Shop").Page("GCR Shop_3")_;_script infofile_;_ZIP::ssf5.xml_;_
If Browser("GCR Shop").Page("GCR Shop_3").Link("Log Off").Exist(10) Then @@ hightlight id_;_Browser("GCR Shop").Page("GCR Shop 3").Link("Log Off")_;_script infofile_;_ZIP::ssf8.xml_;_
Login = "Login Successful - Passed"
Else
Login = "Login Unsuccessful -Failed"
End If
Msgbox Login
End Function
'**************************************
'    Verify object Count
'**************************************
Function VerifyObjects_Count()
    Dim oObject, Objects
    Set oObject = Description.Create
   
    Set Objects = Browser("GCR Shop").Page("GCR Shop").ChildObjects(oObject)
   
If Objects.Count = 47 Then
    VerifyObjects_Count = "Objects Count is Correct- Passed"
    Else
    VerifyObjects_Count = "Objects Count is Incorrect- Failed"
End If   
Msgbox VerifyObjects_Count
End Function
'***************************************
'    Close Application
'***************************************
Function Close_App()
    If Browser("GCR Shop").Exist(4) Then
        Browser("GCR Shop").Close
    End If
    Wait 9
    If Not Browser("GCR Shop").Exist(3) Then
        Close_App = "Application Closed - Passed"
        Else
        Close_App = "Application Not Closed - Failed"
    End If
    Msgbox Close_App
End Function
'***************************************

1 comments:

should we expect part 5 of this Automation Framework series?

Post a Comment