What is a CHROME WebDriver ??
It is an open Source Tool for Automated Testing of Web-Pages in Google Chrome.
It provides capabilities for
- Navigating to web pages
- User input
- JavaScript execution, and more.
Installing CHROME WebDriver
Step 1
Download the latest Release from chrome webdriver Page
Step 2
Unzip the downloaded file(chromedriver_win32)
Step 3
After Unzip we have chromedriver file copy this file to C:\Python\Scripts\
Step4
Open IDLE and type,
Chrome is Up & Running.
and then LogOut.
Download the latest Release from chrome webdriver Page
Step 2
Unzip the downloaded file(chromedriver_win32)
Step 3
After Unzip we have chromedriver file copy this file to C:\Python\Scripts\
Step4
Open IDLE and type,
Chrome is Up & Running.
Steps to be followed before writing a Test Scrips
- Understand the Requirement
- Write Test Plan and Test Cases
- Decide which Test Case to Automate
- Inspect the required Web UI elements
- Starting writing your Test Script
and then LogOut.
Step 1
Requirement:Accessing your Gmail Account using Selenium(Gmail Sign In)
Test Scenarios
Step 2
Test Scenarios
- Enter a Valid UserName ,Password & login,check for the Username in the HomePage.
- Logout and check for the Gmail Login Page.
Test Case
Log In
Log In
- Open the Browser.
- Navigate to "http://gmail.com"
- Verify the Title of Gmail Login Page.
- Enter the Username and Password and click submit.
- Verify the Username in the HomePage
- Hover Over the Username in the Home Page
- Click the LogOut Button
- Verify the Title of Gmail Login Page.
Step 3
We are going to use FireBug to extracting the HTML ID ,HTML NAME of UI elements.
FireBug can be downloaded from this URL
Open FireBug
Step 2 :
Inspecting elements with FireBug
Right click over the element to be inspected.
For LogIn Test Case
1)Username Inspection
Username can be located using HTML ID & NAME
2)Password Inspection
Password can be located using HTML ID & NAME
3)SignIn Button Inspection
FireBug can be downloaded from this URL
Working With FireBug
Step 1 :Open FireBug
Inspecting elements with FireBug
Right click over the element to be inspected.
For LogIn Test Case
1)Username Inspection
Username can be located using HTML ID & NAME
2)Password Inspection
Password can be located using HTML ID & NAME
3)SignIn Button Inspection
Submit Button can be located using HTML ID & NAME
FirePath can be downloaded from this URL
Step 1 :
Select FirePath
Step 2 :
For LogOut Test Case
1)Inspect the Username in HomePage
Xpath for Username found in the HomePage
2)Inspect SignOut
Finally the Test Script
Output
Working With FirePath
To access the xpath of Web - UI elementsFirePath can be downloaded from this URL
Step 1 :
Select FirePath
Step 2 :
For LogOut Test Case
1)Inspect the Username in HomePage
Xpath for Username found in the HomePage
2)Inspect SignOut
Finally the Test Script
Output
No comments:
Post a Comment