Android apps to use in appium android test examples

Breaking

Sunday, June 10, 2018

Selenium Live Project Tutorial


Functional Test Automation using Selenium Selenium Live Project Tutorial
Selenium Live Project Tutorial

Functional Test Automation using Selenium,

1) Project Information
2) Project Description
3) Stake holders of the Project
4) Interfaces of the Project /AUT
5) Features to hold out Tested inward Admin Interface
6) Features to hold out Tested inward User Interface
7) Test Requirements, Test Scenarios, as well as Test Cases.
8 Derive Smoke Test Cases for Admin Interface
9) Derive Smoke Test cases for User Interface
10) Derive Comprehensive (All Possible) Test Cases for Admin Interface
11) Derive Comprehensive (All Possible) Test Cases for User Interface
-------------------------------------------
1) AUT / Project Information

Domain: Ecommerce
(An Area- General, Project Business Area-Software Development/Testing)

Important Domains inward the information technology Industry:

BFSI,
Banking,
Insurance,
ERP,
Telecom,
Healthcare,
Ecommerce,
Retail Market,
Others... (Anti Virus, Games, System Software etc...)

AUT - Application Under Test
-------------------------------------------
Sub-Domain: Business to Customer (B2C)
(Ecommerce - Business to Business (B2B), B2C, C2B, C2C)

Application: Online shopping spider web portal

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

Type of the AUT: gcrShop (Internet Public Application)
-------------------------------------------
2) Project Description

This Web portal has 2 of import interfaces 1) Admin Interface (Maintenance), 2) User Interface (Business Operations)
Categories:
i) Some Web developers prepare Web portals as well as supply interface (for concern operations) betwixt manufacturers as well as Customers,
Ex: Snapdeal, Flipcart etc...

ii) Some Manufactures prepare their ain portal for online shopping,
Ex: telibuy.in etc...

Note: Our AUT (www.gcrit.com) is showtime category of Project,
-------------------------
In Admin interface, manufacturers showtime Register, Add Categories, Edit Categories, as well as Delete categories,
Add Products, Edit Products, delete Products, Track Reports/Status, 
Portal possessor Admin user Add Currencies, Edit Currencies, Delete Currencies, as well as Set default Currency etc...

In User Interface, anybody tin lav launch the Application, View products, Search products, Customer Registration,
Customer Login, Buy Products (select products, Update Quantity, Checkout, Track Orders, etc...)
-------------------------
Web Developer /Web Portal developer provides interface betwixt Manufacturers as well as Customers,
Manufacturers  show their products, as well as sell,
Financial Service providers (Ex: Paypal etc...) supply Payment transactions,
Customers sentiment products info, search products, Register, login, Buy products, Track orders etc...
-------------------------------------------
3) Stake Holders of the Project

i) Web Portal Developer/s...
ii) Manufacturer/s
iii) Financial Service provider/s
iv) Distributers of the Manufacturer/s
v) Courier service provider/s
vi) Customers (General, as well as Registered Customers...)
-------------------------------------------
4) Interfaces of the Project /AUT

This (gcrit.com) Application has 2 of import Interfaces,

i) gcrShop Admin Interface (Handle (Add/Edit/Delete)Master Data, Maintenance of the App/Business...)

Master Data: Required Data for Running the Application.

(Ex: In Banking Application, Add Bank info, Branches, ATMs, Products, Bank history...)

Maintenance of the Business / Application.
--------------------
gcrShop Admin Interface details:

URL: http://www.gcrit.com/build3/admin

http - Hyper Text Transfer protocol 
www - World Wide Web
gcrit.com - Web Domain / Web Address
build3 - Folder
admin - Sub-Folder
Admin Login:
Username: admin
password: admin@123
--------------------
ii) gcrShop User Interface (Business Operations (View product, search products, registration, login, 
buy products, get orders, etc...)

gcrShop User Interface Details:

URL: http://www.gcrit.com/build3/

Note: No restrictions, anybody tin lav utilisation the application, but if you lot desire purchase products as well as thus you lot take away to
register (Free) as well as Login...
------------------------
www.gcrit.com/build3/

www - World Wide Web 
gcrit.com - Web Domain / Web Address 
build3 - Folder 
-----------------------
http://us.sulekha.com/

us - Sub Domain
sulekha.com - Domain

http://www.korada.com/telugu/

korada.com - Domain
telugu - Folder
-------------------------------------------
5) Features to hold out Tested inward Admin Interface

i) Launch the Application
ii) Admin Login to Application
iii) Redirect functioning from Admin to User Interface
iv) Add/Edit/Delete Manufacturers
v) Add / Edit / Delete Categories
vi) Add / Edit / Delete Products
vii) Add/Edit/Delete/Set equally default Currency
viii) User & Product Reports as well as Track Status
-------------------------------------------
6) Features to hold out Tested inward User Interface

i) Launch the Application
ii) Search, View Products
iii) Customer Registration
iv) Customer Login
v) Buy Products (Login, Buy Product/s, Update Quantity, delete products, Change the Details, payment option, checkout.)
vi) Track Order status
-------------------------------------------
7) Test Requirements, Test Scenarios, as well as Test Cases.

Business Requirements
Software Requirements
Test Requirements
Test Scenarios (Positive & Negative)
Test Cases (* Test Data is required for about Test cases only)
------------------------
Test Requirement/s
Functional Requirement
Non Functional Requirement 
Performance Requirement
Load Test Requirement
Stress Test Requirement
Spike Test Requirement
Endurance Test Requirement...
Usability Testing
Reliability Testing
Localization Testing / Internationalization Testing 
Availability Testing
Configuration Testing
Recovery Testing
Etc...
--------------------------
Functional Test Requirement
Ex: Admin user Login to Admin Interface of the Application
---------------------
Test Scenarios:
i) Admin Login amongst valid Username, as well as Password (Positive Test Scenario) 
ii) Admin Login amongst invalid Username, as well as valid Password (Login failed attempt) (Negative scenario 1)
iii) Admin Login amongst valid Username, as well as invalid Password (Login failed attempt) (Negative scenario 2)
iv) Admin Login amongst invalid Username, as well as invalid Password (Login failed attempt) (Negative scenario 3)
v) Admin Login amongst Blank Username, as well as valid Password (Login failed attempt) (Negative scenario 4)
vi) Admin Login amongst Valid Username, as well as Blank Password (Login failed attempt) (Negative scenario 5)
Etc...
----------------------
Test Case:

Test  Case ID: TC_Ad_001
Test Case Name/Description: Admin user Login to Admin Interface of the Application (gcrShop)
Test Suite Id: TS_Ad_01
Priority:
Pre-Condition:
Steps to hold out Executed:
Post-Condition:
Expected Result:
Hardware as well as Software:
Actual Result:
Status: 
-------------------------
Test Data:
Username: admin
Password: admin@123
--------------------------
No Test Data for about Test Cases (NA)
Ex: Redirect from Admin to User Interface earlier Admin Login
-------------------------------------------
8) Derive Smoke Test cases for Admin Interface

i) Verify Launch the Application (Admin Interface) amongst valid URL
ii) Verify Required Elements availability of Login Page
iii) Verify Admin Login amongst valid input information to Admin Interface of the Application
iv) Verify Required Elements availability of Admin index page (after Login)
v) Verify Add Manufacturer
vi) Verify Add Category
vii) Verify Add Product
viii) verify Add Currency
ix) Set default Currency
Etc...
-------------------------------------------
9) Derive Smoke Test cases for User Interface

i) Verify Launch the User Interface of the Application amongst valid URL
ii) Verify Required Elements availability of User interface Homepage
iii) Verify Customer Registration to the Application amongst valid Input data
iv) Verify Customer Login to User Interface
v) Verify Add Product/s (Update Quantity...)
vi) Verify Change Customer Address details
vii) Verify Checkout
viii) Verify client Track Order
Etc...
-------------------------------------------
10) Derive Comprehensive (All possible examination cases) Test cases for Admin Interface

i) Verify Launch the Application (Admin Interface) amongst valid URL
ii) Verify Required Elements availability of Login Page
iii) Verify Redirect from Admin to User Interface earlier Admin Login
iv) Verify Admin Login amongst valid input information to Admin Interface of the Application
v) Verify Redirect from Admin to User Interface After Admin Login
vi) Verify Admin Login amongst Invalid input information (Login failed attempt) to Admin Interface of the Application
vii) Verify Admin Failed Login Attempt later on three Failed attempts
viii) Verify Admin Login amongst valid input information to Admin Interface of the Application inside v minutes
ix) Verify Admin Login amongst valid input information to Admin Interface of the Application later on v minutes
x) Verify Required Elements availability of Admin Index page (After Admin Login)
xi) Verify Add Manufacturer
xii) Verify Edit Manufacturer
xiii) Verify Delete Manufacturer
xiv) Verify Add Category
xv) Verify Edit Category
xvi) Verify Delete Category
xvii) Verify Add Product
xviii) Verify Edit Product
xix) Verify Delete Product
xx) Verify Add Currency
xxi) Verify Edit Currency
xxii) Verify Delete Currency
xxiii) Verify Set a Currency a Default
xxiv) Verify Customer Reports
xxv) Verify Product Report
Etc...
-------------------------------------------
11)  Derive Comprehensive (All Possible Test Cases) Test Cases for User Interface

i) Launch gcrShop User Interface amongst valid URL (http://www.gcrit.com/build3/)
ii) Verify "Elements" introduce inward the User Interface domicile page
iii) Verify "Products "Search"
iv) Verify "Products "Advanced Search"
v) Verify "create an account" amongst valid inputs (enter all mandatory fields)
vb) Verify "create an account" amongst invalid inputs as well as move inward all mandatory fields
vc) Verify "create an account" amongst invalid inputs as well as without entering all mandatory fields
vi) Verify "costumer login" inward to User Interface amongst valid inputs
vib) Verify "costumer login" inward to User Interface amongst invalid inputs
vii) Verify "Shopping Cart" earlier select whatever product
viii) Verify "Shopping Cart" later on select a product/s
a) Verify "Update" inward Shopping Cart for unmarried (selected unmarried production only) product 
b) Verify "Update" inward Shopping Cart for multiple (selected multiple products) products
c) Verify "Remove" inward Shopping Cart for unmarried (selected unmarried production only) product 
d) Verify "Remove" inward  Shopping Cart for multiple (selected multiple products) products
xii)  Verify "Checkout" earlier selecting as well as production as well as earlier login
xiii) Verify "Checkout" later on selecting product/s as well as later on login
a) Verify "Change Address" inward Checkout procedure later on selecting product/s as well as later on login
b) Verify "Payment Option" inward Checkout procedure later on selecting product/s as well as later on login
1) Verify amongst "Cash on delivery"
2) Verify amongst "PayPal" 
c) Verify "Add Comments" inward Checkout procedure later on selecting product/s as well as later on login
d) Verify "Checkout" Process 
xviii) Verify Customer "LogOff" 
xix) Verify "Close Application" earlier LogOff
xx) Verify "Close Application" later on "LogOff
Etc...
-----------------------------------------------------------------------
Derive Smoke Test Scenarios for Admin Interface

Note 1: If you lot write about Test Cases spell Smoke Test Design, you lot tin lav copy/use those Test cases for Comprehensive Test Design, Regression Testing also.

Note 2: If you lot execute about Test Cases spell Smoke Testing, as well as thus execute those Test cases equally good (Don't Skip) spell Comprehensive Testing.
----------------------------------------------------------------------
1) Verify "Launch Application (gcrShop Web portal Admin Interface)" using valid URL
2) Verify "Admin Login" inward gcrShop Web portal Admin Interface amongst valid Inputs
3) Verify "Important / Required Elements availability" inward gcrShop Web portal Admin Interface index page (after Logion)
4) Verify "Add Manufacturer" inward gcrShop Web portal Admin Interface index page
5) Verify "Add Category" inward gcrShop Web portal Admin Interface index page
6) Verify "Add Product" inward gcrShop Web portal Admin Interface index page
7) Verify "Add Currency" inward gcrShop Web portal Admin Interface index page
8) Verify "Track Report" inward gcrShop Web portal Admin Interface index page
----------------------------------------------------------------
1) Verify "Launch Application" (Admin Interface) amongst Valid URL

Test Case Name: Lunch Admin Interface of the Application (gcrShop) amongst valid URL
Test Steps:
1) Instantiate Browser (For Selenium 3.0, it is required to Instantiate every Browser including Mozilla Firefox)
(You tin lav launch either Firefox or Chrome or MS Edge etc...)
2) Create Browser driver example /object
3) Navigate to gcrShop Admin Page ("http://www.gcrit.com/build3/admin/")
Verification Point
1) Verify Elements (Username, Password, Login) inward the Login Page, if they are available as well as thus pass
Note: We can't utilisation "Page Title" (It may duplicate), or URL (sometimes page may non opened upward /white screen).
Test Data / Input Data
NA
Test Result / Status (Pass / Fail) : * After Test Case Execution 
----------------------------------------------------------------
2) Verify "Admin Login" amongst valid inputs

Test Case Name: Verify gcrShop Admin Login inward Admin Interface amongst valid Inputs (Username as well as Password)
Test Steps: 
1) Instantiate Browser 
2) Create Browser driver example /object
3) Navigate to gcrShop Admin Page ("http://www.gcrit.com/build3/admin/")
4) Enter valid "Username"
5) Enter valid "Password"
6) Click "Login"

Verification Point/s:
1) Capture the Browser URL (After Login) as well as Compare amongst Expected URL

Test Data / Input Data:
1) Username: "admin"
2) Password: "admin@123"

Test Result / Status (Pass / Fail):
----------------------------------------------------------------
3) Verify "Important / Required Elements Availability as well as banking concern represent the functionality" inward gcrShop Web portal Admin Interface index page (after Login)

Test Steps:
1) Instantiate Browser (For Selenium 3.0, it is required to Instantiate every Browser including Mozilla Firefox)
(You tin lav launch either Firefox or Chrome or MS Edge etc...)
2) Create Browser driver example /object
3) Navigate to gcrShop Admin Page ("http://www.gcrit.com/build3/admin/")
4) Enter valid "Username"
5) Enter valid "Password"
6) Enter / Click "Login" Button
* Verification for Login is Optional

Verification Point/s
Verify "Manufacturer", "Category", "Currency" as well as "Product" Elements availability as well as Check / Click...

Test Data / Input Data

Username: "admin"
Password: "admin@123"
----------------------------------------------------------------
4) Verify "Add Manufacturer" inward gcrShop Web portal Admin Interface index page

Test Steps:
1) Instantiate Browser (For Selenium 3.0, it is required to Instantiate every Browser including Mozilla Firefox)
(You tin lav launch either Firefox or Chrome or MS Edge etc...)
2) Create Browser driver example /object
3) Navigate to gcrShop Admin Page ("http://www.gcrit.com/build3/admin/")
4) Enter valid "Username"
5) Enter valid "Password"
6) Enter / Click "Login" Button
* Verification for Login is Optional
7) Click "Manufacturer" Link
8) Select "Insert" Link
9) Enter "Manufacturer Name"
10) Upload "Manufacturer Image" * Optional
11) Enter "Manufacturer URL" * Optional

Verification Point/s
Capture Manufacturers count Before Add Manufacturer as well as After Add Manufacturer as well as Compare these 2 values.

Username: "admin"
Password: "admin@123"
----------------
Manufacturer Name: Ravindra
Manufacturer Image File * Optional
Manufacturer URL * Optional
----------------------------------------------------------------
Test Types
Functional Testing
Non Functional Testing
Structural Testing
Change Related Testing or Regression Testing or Conformation Testing

Non -Functional 
Functional Testing
Functionality Testing
Security Testing...

Non Functional Testing
Performance Testing
Load Testing
Stress Testing
Spike Testing
Data book Testing...
Usability Testing
Reliability Testing 
Recovery Testing
Availability Testing
Localization Testing / Internationalization Testing
Configuration Testing
Installation Testing Etc...
----------------------------------------------------------------
5) Verify "Add Category" inward gcrShop Web portal Admin Interface index page

1) Instantiate Browser (For Selenium 3.0, it is required to Instantiate every Browser including Mozilla Firefox)
(You tin lav launch either Firefox or Chrome or MS Edge etc...)
2) Create Browser driver example /object
3) Navigate to gcrShop Admin Page ("http://www.gcrit.com/build3/admin/")
4) Enter valid "Username"
5) Enter valid "Password"
6) Enter / Click "Login" Button
* Verification for Login is Optional
7) Click "Categories/Products" Link
8) Click "New Category" Link
9) Enter "Category Name"
10) Upload "Category Image" * Optional
11) Enter a value for Sort Order * Optional / Important
12) Click "Save" Button

Verification Point/s
Find Entered category inward the Categories listing as well as detect the kind seat also

Test Data:
Username: "admin"
Password: "admin@123"
------------
Category name: abcde
Category Image File * Optional
Category Sort value": seven * Optional
----------------------------------------------------------------
Selenium Web Driver Test Batch for Admin Login Interface Smoke Tests

package abcd;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public cast AdminInterface {

public static WebDriver driver;

public void launchApplication(){
driver = novel FirefoxDriver();
driver.get("http://www.gcrit.com/build3/admin/");
}
public void closeApplication(){
driver.close();
}
public void adminLogin(String Username, String Password){
driver.findElement(By.name("username")).sendKeys(Username);
driver.findElement(By.name("password")).sendKeys(Password);
driver.findElement(By.id("tdb1")).click();
}
public void addManufacturers(String Name){
driver.findElement(By.linkText("Manufacturers")).click();
driver.findElement(By.className("ui-button-text")).click();
driver.findElement(By.name("manufacturers_name")).sendKeys(Name);
driver.findElement(By.id("tdb1")).click();
}
public void addCategory(String Name){
driver.findElement(By.linkText("Categories/Products")).click();
driver.findElement(By.className("ui-button-text")).click();
driver.findElement(By.name("categories_name[1]")).sendKeys(Name);
driver.findElement(By.id("tdb3")).click();
}
/*public void addProduct(String Name){
driver.findElement(By.linkText("Categories/Products")).click();
driver.findElement(By.xpath(".//*[@id='tdb2']/span[2]")).click();
driver.findElement(By.name("manufacturers_name")).sendKeys(Name);
driver.findElement(By.id("tdb1")).click();
}*/
public static void main(String[] args) throws InterruptedException {
AdminInterface obj = novel AdminInterface();
//Test Case 1: Verify "Launch Application (gcrShop Web portal Admin Interface)" using valid URL
obj.launchApplication();
boolean Username = driver.findElement(By.name("username")).isDisplayed();
boolean Password = driver.findElement(By.name("password")).isDisplayed();
boolean Login = driver.findElement(By.id("tdb1")).isDisplayed();

if (Username == truthful && Password == truthful && Login == true){
System.out.println("Test Case 1: "+"Username, Password, as well as Login Elements Exit - Passed");
}
else
System.out.println("Test Case 1: "+"Username, Password, as well as Login Elements Not Exit - Failed");
obj.closeApplication();
//Test Case 2: Verify "Admin Login" inward gcrShop Web portal Admin Interface amongst valid Inputs
obj.launchApplication();
obj.adminLogin("admin", "admin@123");
String url = driver.getCurrentUrl();

if (url.equals("http://www.gcrit.com/build3/admin/index.php")) {
System.out.println("Test Case 2: "+"Admin Login Successful - Passed");
}
else {
System.out.println("Test Case 2: "+"Admin Login Unsuccessful - Failed");
}
obj.closeApplication();
//Test Case 3: Verify "Important / Required Elements availability" inward gcrShop Web portal Admin Interface index page (after Logio
obj.launchApplication();
obj.adminLogin("admin", "admin@123");
boolean Manufacturers = driver.findElement(By.linkText("Manufacturers")).isDisplayed();
boolean CatandProduct = driver.findElement(By.linkText("Categories/Products")).isDisplayed();

if (Manufacturers == truthful && CatandProduct == true){
System.out.println("Test Case 3: "+"Manufacturers, Categories, as well as products elements Exit - Passed");
}
else
{
System.out.println("Test Case 3: "+"Manufacturers, Categories, as well as products elements Not Exit - Failed");
}
obj.closeApplication();
//Test Case 4: Verify "Add Manufacturer" inward gcrShop Web portal Admin Interface index page
obj.launchApplication();
obj.adminLogin("admin", "admin@123");
//String Man_count = driver.findElement(By.xpath(".//*[@id='contentText']/table/tbody/tr[2]/td/table/tbody/tr/td[1]/table/tbody/tr[22]/td/table/tbody/tr/td[1]/strong[3]")).getText();
obj.addManufacturers("Ahalya3");
String Man_count = driver.findElement(By.xpath(".//*[@id='contentText']/table/tbody/tr[2]/td/table/tbody/tr/td[1]/table/tbody/tr[22]/td/table/tbody/tr/td[1]/strong[3]")).getText();
int Manf_count = Integer.parseInt(Man_count);
driver.navigate().refresh();
Thread.sleep(5000);
if (Manf_count == 196){
System.out.println("Test Case 4: "+ "Manufacturer Added - Passed");
}
else {
System.out.println("Test Case 4: "+ "Manufacturer Not Added - Failed");
}
obj.closeApplication();
}
}

------------------------------------------------------------------------------------

Sumber http://www.gcreddy.com/

No comments:

Post a Comment