Write outset Selenium Test Case

Write starting fourth dimension Selenium Test Case

Manual Test Case:

Test Case ID: gcrshop_admin_TC001

Test Case Name: Verify Admin Login inwards GCR Shop spider web portal.

Test Steps:
i) Launch the Browser
ii) Navigate to gcr Shop Admin Interface ("http://www.gcrit.com/build3/admin/")
iii) Enter "Username"
iv) Enter "Password"
v) Click "Login" Button

Input Data / Test Data

Username = "admin"
Password = "admin@123"

Verification Point: 
Capture the URL later Login as well as compare amongst expected

Expected URL: http://www.gcrit.com/build3/admin/index.php

Actual:

Rest Result: Pass/Fail
------------------------------------------------------
Selenium WebDriver Test Case

Download Browser driver (Mozilla Firefox)- gecko driver as well as extract

Gecko is a spider web browser engine used inwards many application developed yesteryear Mozilla Foundation, as well as the Mozilla Corporation.

Gecko driver is the link betwixt our Test Cases inwards Selenium as well as the Firefox browser,

Note: In previous versions of WebDriver, no Gecko Driver, Firefox Browser is the default Browser.
But inwards selenium 3.0, no default browser, nosotros need ti instantiate as well as exercise the Browser driver (Any browser),
--------------------------------------------------------------
Admin Login to GCR Shop Admin Interface

Elements inwards this Navigation:

i) Username - Edit box - advert - username
ii) Password - Edit box - advert - password
iii) Login - Button - id - tdb1
-------------------------------
If It is Mozilla Firefox Browser hence nosotros tin use,
Built-in Feature - Page Inspector
Or
Download as well as Add Plug ins inwards Mozilla Firefox Browser...
Firebug, Firepath
-----------------------------------
Selenium was developed inwards Java,
UFT/QTP was developed inwards VC++.NET
------------------------------------------------
WebDriver Test Case:

WebDriver driver = novel FirefoxDriver()

public course of education AdminLogin {

public static void main(String[] args) {
//Instantiate Gecko driver (It provides link betwixt Selenium Test Case as well as Mozilla Firefox Browser)
//System.setProperty("webdriver.gecko.driver", "D:/geckodriver.exe");
//Create Firefox browser driver inwards Selenium WebDriver interface...
WebDriver driver = novel FirefoxDriver();//It launches Firefox browser amongst blank url
driver.get("http://www.gcrit.com/build3/admin/");
driver.findElement(By.name("username")).sendKeys("admin1");
driver.findElement(By.name("password")).sendKeys("admin@123");
driver.findElement(By.id("tdb1")).click();

String URL = driver.getCurrentUrl();

if (URL.equals("http://www.gcrit.com/build3/admin/index.php")){
System.out.println("Admin Login Successful - Passed");
}
else {
System.out.println("Admin Login Unsuccessful - Failed"); 
}
driver.close();
}
}
-----------------------------------------------------------------
How to verify Selenium WebDriver Environment?

Write as well as Execute a Sample Test case.

How to Create Selenium WebDriver Test Cases?

using Element Locators as well as WebDriver API Commands nosotros tin write Selenium WebDriver Test cases.

How to Inspect Elements inwards Mozilla Firefox Browser?

Mozilla Firefox has built inwards characteristic called "Page Inspector", using Page Inspector nosotros tin inspect Elements, 

> Launch Mozilla Firefox Browser





Sumber http://www.gcreddy.com/
Post a Comment (0)
Previous Post Next Post