Selenium Tutorial 16: Introduction to Selenium WebDriver

preview_player
Показать описание
Introduction to Selenium WebDriver tutorial explains features of Selenium webDriver, drawbacks of WebDriver, Selenium WebDriver Environment setup. Create Selenium Test Case using Element locators and WebDriver Commands. WebDriver Fundamentals and Features, configure WebDriver and create Test cases.
Рекомендации по теме
Комментарии
Автор

Very descriptive & useful for beginners !! Thanks a lot, Sir !!!

woodfire
Автор

Very good and descriptive video. Thanks a lot G.C.Reddy :)

grvlal
Автор

Thank you much Sir!!! I{ love your videos every step explained in detail what it does!!! Thanks again and God Bless!!!

elkhanhamet
Автор

Class Notes:
Selenium Class 16: Introduction to Selenium WebDriver

i) Introduction to Selenium WebDriver

ii) WebDriver Environment Setup

iii) Create first Selenium Test Case

i) Introduction to Selenium WebDriver

Selenium Tool’s Suite
Selenium IDE
Selenium RC
Selenium WebDriver
Selenium Grid

> In 2006 Selenium WebDriver was launched at Google.

> In 2008, the whole Selenium team decided to merge Selenium WebDriver with Selenium RC in order to form more powerful tool called Selenium 2.0

Selenium 1.0 + WebDriver = Selenium 2.0

Selenium 1.0

(Selenium IDE + Selenium RC + Selenium Grid)

Selenium 2.0

(Selenium IDE + Selenium RC + Selenium WebDriver + Selenium Grid)

Note: Now Selenium RC is only for maintenance projects.

> It is a most important tool in Selenium Suite.

> It has Programming interface only, no IDE.

> Selenium WebDriver supports various programming languages to write programs (Test scripts)

Java
Python
C#
Ruby
Perl
PHP

> Selenium WebDriver supports various Browsers to create and execute Test cases.

Mozilla Firefox

Google Chrome

IE

Safari

Opera etc...

> Selenium WebDriver supports various Operating environments.

MS Windows

Linux

Macintosh etc...

> Selenium WebDriver supports Data driven Testing and Cross browser testing.

> Selenium WebDriver is faster than other tools of Selenium suite.

> Selenium WebDriver supports Parallel test execution with the help of either JUnit or TestNG.

Drawbacks of selenium Webdriver

> Selenium WebDriver doesn't have IDE (some difficult to create test cases)

> No Built-in Result reporting facility.

> No other tool Integration for Test management.

> No centralized maintenance of Elements/objects.

How we create Test Cases /Test Scripts / Tests in Selenium WebDriver:

In UFT:

Using Objects information and Test Methods we create Tests.

In Selenium WebDriver:

Using Element Locators and Webdriver Commands/methods we create Test Cases.

Selenium IDE:

Using Element locators and Selenese / Selenium IDE commands we create Test cases

Element Locators - to recognize elements/identify elements.

WebDriver commands/methods - to perform operations on elements.

Java Programming - for enhancing Test Cases

TestNG Framework - for grouping Test cases, batch Testing and generating Test Reports.

ii) Selenium WebDriver Environment Setup.

Steps:

i) Download and Install Java (JDK) software -to create programs (Test scripts)

ii) Set Environment variable (path variable).

iii) Download Eclipse IDE and extract - to write and execute Java programs.

iv) Download Webdriver Java language binding (www.seleniumhq.org) and add WebDriver jar files to Java project in Eclipse IDE.

v) Install Firebug and Firepath plug ins (Mozilla Firefox) for inspecting elements.

vi) For Internet Explorer and Google Chrome, no need to install any plug in, they have
built in developer tools(F12) for inspecting elements.

vii) Firefox driver is default driver in Seelenium Webdriver, for IE and Chrome etc... Browsers then we need to download browser drivers.

Download Selenium WebDriver Java language binding from www.seleniumhq.org website and extract.

Add WebDriver jar files to Java Project in Eclipse IDE

Navigation:

Create Java Project

> Select Java project and right click

> Build path

> Configure build path

> Select "Libraries" tab

> Click "Add external Jars"

> Browse path of the WebDriver jars.

> Add

Create selenium WebDriver Test Case

> Import Webdriver and Firefox/IE/Chrome Libraries. (In Selenium Test Case/Program)

> Using Element locators and Webdriver commands write test steps.

> Insert java programming statements to enhance Test cases.

> Using TestNG Annotations group test cases, execute test batches and generate detailed test reports.

iii) Write first Selenium Test Case

Manual Test Case

Test Case ID: gcrshop_admin_TC001

Test Case Name: Verify Admin Login in GCR shop Web Portal

Test Steps:

1) Launch the Browser and navigate to "www.gcrit.com/build3/admin"
2) Enter User name
3) Enter Password
4) Click Login Button

Input data:

Username = admin

Expected URL:


Test Result: Pass

* Verification point: Capture the Browser URL after submission of Login details and compare with expected URL.

Selenium WebDriver Test Case:

public class AdminLogin {

public static void main(String[] args) {
WebDriver driver = new FirefoxDriver(); //Launches Firefox Browser with blank url



String url = driver.getCurrentUrl();
System.out.println("Login Successful -Passed");
}
else
{
System.out.println("Login Unsuccessful -Failed");
}
driver.close(); //Closes the Browser
}
}

gcreddy
Автор

Sir, I'm also getting the same error like Mohankrishna.
Can you pls help me Sir to get rid of it?

priyasai
Автор

Requires a lot of patience to watch the video, but still it is worth watching. Appreciate the effort. Best Regards.

anurag
Автор

i am unable to add selenium jar files after click on Add external jar it is showing modulepath and classpath

shantanurajderkar
Автор

Sir, I am Facing the issue Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms, even after using the Firefox 46 with Java jdk 10 and Eclipse latest Oxygen Version.

kishorekiran
Автор

Hi Sir,

The package org.openqa.selenium is accessible from more than one module: client.combined, okio

Above is the error I am facing can you please help me with that.

yogitabaliyanapu
Автор

Sir, while setting path of Java WebDriver Jar file in Eclipse & ran the program, it is giving me error saying org/openqa/selenium/WebDriver : Unsupported major.minor version 52.0", and programe exited .
My setup Environment is :
OS : Windows7
JDK : 1.8.0_101
JRE :
C:\Users\kaimerch>java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

kaizarmerchant
Автор

Sir, Im following your videos and i have downloaded old version, even then unable to create an object for FirefoxDriver.as the package used by you is not able to recognise. Please assist

shaziakulsumsj
Автор

Can any one help me?

program is opening and closing the browser.. able to open the browser but its not getting closed automatically after running the code.

akhilgupta
Автор

hello m getting the problem while executing program for admin login class....the error is Error: Could not find or load main class sanitytests.Adminlogin..plz help me sir

gayatrideshmukh
Автор

about:blank&utm_content=firstrun, , I am getting this error when running the java program to launch through eclipse, i already added selenium 2.53 and currently using firefox 46.0.1.. so kindly update asap

akhileshtripathi
Автор

The im port org.openqa.selenium.WebDriver cannot be resolved --- how to resolve this issue

DebjyotiBiswas
Автор

My values are not entered into the textbox into the application. It just loads the website page and not allows to enter the value into the textbox of the website page

munnambabar
Автор

It's not working with Mozilla FireFox and getting Error like "Exception in thread "main" Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: VISTA"

mohankrishnad
Автор

G C Reddy Sir Thanks a lot for for providing these videos. I am facing a problem on both Macintosh and Windows Environment. Using Eclipse mars 2 with selenium 2.51.0 or 2.53.1 when I run the program Browser(Firefox 51.0.1) is opening but url is not redirecting . I am not able to understand the problem what is happening.Please help me on this Thanks

atulbhatt
Автор

Sir, is the class notes available for this session?? Can you please share.

indranilsarkar
Автор

sir please where is the link of selenium java 2.51.0

mathuyuvan