SlideShare a Scribd company logo
www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING
www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING
What Will You Learn Today?
 Limitations of Selenium WebDriver
 No support for testing images
 Not efficient Managing test cases
 No support Report generation
 Sikuli for testing images on the web
 Annotating tests and managing test cases using TestNG
 Generating HTML reports using TestNG
www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING
Sikuli & TestNG Are Used In Selenium
WebDriver Because Of Its Limitations
www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING
Shortcomings Of Selenium WebDriver
Dependency on external tools for Test management
Images cannot be tested in Web applications
Does not have Reporting facility
www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING
I have to verify
the images that
are present in
the web page
But, Selenium
doesn’t support
image based
testing
NOTE: Sikuli and Selenium can be integrated to also automate desktop applications
Need To Do Image Based Testing
www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING
I have to verify
the images that
are present in
the web page
But, Selenium
doesn’t support
image based
testing
NOTE: Sikuli and Selenium can be integrated to also automate desktop applications
Simple. Integrate
Sikuli with
Selenium for
testing images
Sikuli For Image Testing
www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING
Selenium + Sikuli
Selenium
Sikuli
Image Testing + Web Testing
www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING
How Does Sikuli Work?
• Uses image recognition techniques to test images visible on screen
• It then performs operations on those images
• Provides a GUI for scripting where screenshots/ images are sent as
parameters
“Automate anything you see on your screen ”
-
www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING
Sikuli IDE
• find
• findAll
• wait
• waitVanish
• exists
Image Searching Commands
• click
• doubleClick
• hover
• dragDrop
• rightClick
Mouse Action Commands
Image to be
recognized
Action to be
performed
www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING
I have a very long
code. Managing
various Test cases
is wearisome!
Neither do I
get detailed
reports about
those tests!!
Other Limitations Of Selenium
www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING
I have a very long
code. Managing
various Test cases
is wearisome!
Neither do I
get detailed
reports about
those tests!!
Both the problems can
be solved!
Use TestNG in Selenium
for Test management &
Report generation
TestNG To The Rescue
www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING
What Is TestNG?
TestNG is an open source testing framework inspired by JUnit. It stands for Test Next Generation
TestNG is more flexible & powerful than JUnit because of below functionalities:
T e s t
S c r i p t s
T E S T R E P O R T S
Prioritization
Method
Dependency
Parallel
Testing
Assertions
Disabling
Test Cases
GroupingAnnotations
Report
Generation
www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING
Advantages Of Using TestNG
• HTML reports can be generated
• Supports parallel testing
• Test cases can be grouped & prioritized easily
• Uses annotations for executing methods
• Supports parameterization
Note: Java is a pre-requisite for TestNG
1. Write the business logic of the test and insert TestNG annotations in the code
2. Add the information about your test (e.g. the class names, methods names,
groups names etc.) in a testng.xml file or build.xml file
3. Run TestNG
Steps for writing TestNG tests
Advantages of using TestNG
www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING
Annotations In TestNG
Annotations in TestNG are used to control the next method to be executed in the program
TestNG programs will not have ‘main’ method. However, all methods will be annotated with ‘@’
Test methods – Primary methods to be executed
Will be executed before both test method
Will be executed after both test method
A n n o t a t i o n s P r i o r i t i z a t i o n
R e p o r t
G e n e ra t i o n
P a r a l l e l
Te s t i n g
A s s e r t i o n sG r o u p i n g
M e t h o d
D e p e n d e n c y
D i s a b l i n g
Te s t C a s e s
www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING
List Of Annotations In TestNG
TESTNG ANNOTAIONS DESCRIPTION
@BeforeSuite Annotated method will run before all the tests in the suite have run
@AfterSuite Annotated method will run after all the tests in the suite have run
@BeforeTest Annotated method will run before any test method belonging to the classes is run
@AfterTest Annotated method will run after all the test methods belonging to the classes have run
@BeforeGroup Annotated method will run before each group is run
@AfterGroup Annotated method will run after every group is run
@BeforeClass Annotated method will run once before the first test method in the current class is invoked
@AfterClass Annotated method will run once after all the test methods in the current class have run
@BeforeMethod Annotated method will run before any test method belonging to the classes is run
@AfterMethod Annotated method will run after all the test methods belonging to the classes have run
@Test Annotated method is a part of test
A n n o t a t i o n s P r i o r i t i z a t i o n
R e p o r t
G e n e ra t i o n
P a r a l l e l
Te s t i n g
A s s e r t i o n sG r o u p i n g
M e t h o d
D e p e n d e n c y
D i s a b l i n g
Te s t C a s e s
www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING
Examples Of Annotations In TestNG
public class TestngAnnotation {
@Test
public void testCase1()
{
System.out.println("in test case 1");
}
@BeforeMethod
public void beforeMethod() {
System.out.println("in beforeMethod");
}
@AfterMethod
public void afterMethod()
{
System.out.println("in afterMethod");
}
@BeforeTest
public void beforeTest()
{
System.out.println("in beforeTest");
}
@AfterTest
public void afterTest()
{
System.out.println("in afterTest");
} }
Main method to be executed
Will be executed before every test method
Will be executed after every test method
Will be executed before test
Will be executed after test
www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING
Prioritization In TestNG
Annotated methods can be prioritized in TestNG
Priority can be assigned as parameters while calling the test cases
If no priority is defined, then the test cases will be executed in alphabetical order
Note: In this case, secondTest() will run first and then firstTest() will run
A n n o t a t i o n s P r i o r i t i z a t i o n
R e p o r t
G e n e ra t i o n
P a r a l l e l
Te s t i n g
A s s e r t i o n sG r o u p i n g
M e t h o d
D e p e n d e n c y
D i s a b l i n g
Te s t C a s e s
www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING
Method Dependency In TestNG
Will execute only if finalTest() method passes
A n n o t a t i o n s P r i o r i t i z a t i o n
R e p o r t
G e n e ra t i o n
P a r a l l e l
Te s t i n g
A s s e r t i o n sG r o u p i n g
M e t h o d
D e p e n d e n c y
D i s a b l i n g
Te s t C a s e s
In TestNG, we can use dependsOnMethods to implement dependency testing
If the dependent method fails, then all the subsequent methods will be skipped
www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING
Always Running Tests In TestNG
In TestNG, we can also choose to run a particular test irrespective of the fail/ pass condition of depending method
We can control that by setting the alwaysRun attribute in @Test annotation; alwaysRun = true
This test will run irrespective of finalTest()
passing/ failing
A n n o t a t i o n s P r i o r i t i z a t i o n
R e p o r t
G e n e ra t i o n
P a r a l l e l
Te s t i n g
A s s e r t i o n sG r o u p i n g
D i s a b l i n g
Te s t C a s e s
M e t h o d
D e p e n d e n c y
www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING
Disabling Test Cases
In TestNG, we can enable or disable test/ test cases as per needs
We can control that by setting the enable attribute in @Test annotation; enabled=true or enabled=false
This test will never be executed in the test case
A n n o t a t i o n s P r i o r i t i z a t i o n
R e p o r t
G e n e ra t i o n
P a r a l l e l
Te s t i n g
A s s e r t i o n sG r o u p i n g
M e t h o d
D e p e n d e n c y
D i s a b l i n g
Te s t C a s e s
www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING
Grouping Tests Into Test Cases
In TestNG, we can categorize certain methods into groups
Methods with same group name can be executed in one group
We can control that by setting the group attribute in @Test annotation; groups={“xxx”}
Note: A Test Case can belong to multiple test groups
A n n o t a t i o n s P r i o r i t i z a t i o n
R e p o r t
G e n e ra t i o n
P a r a l l e l
Te s t i n g
A s s e r t i o n sG r o u p i n g
M e t h o d
D e p e n d e n c y
D i s a b l i n g
Te s t C a s e s
www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING
Assertions In TestNG
Assertions can be used in TestNG to compare the actual result with the expected result
Check if both String 1 and String 2 are equal
Check if call to aMethodCall() returns true
Checks if driver.getTitle() returns vale as “Gmail”
A n n o t a t i o n s P r i o r i t i z a t i o n
R e p o r t
G e n e ra t i o n
P a r a l l e l
Te s t i n g
A s s e r t i o n sG r o u p i n g
M e t h o d
D e p e n d e n c y
D i s a b l i n g
Te s t C a s e s
www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING
Parallel Testing Using TestNG
TestNG provides support for executing scripts in parallel, saving lot of time
Multiple browser testing can be achieved as same scripts can be executed in multiple browser at the same time
A n n o t a t i o n s P r i o r i t i z a t i o n
R e p o r t
G e n e ra t i o n
P a r a l l e l
Te s t i n g
A s s e r t i o n sG r o u p i n g
M e t h o d
D e p e n d e n c y
D i s a b l i n g
Te s t C a s e s
www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING
Running A TestNG Group Of Tests Via testng.xml
We can execute methods belonging to a group in TestNG, by creating testng.xml files
Grouping is one of the annotations, used to execute multiple tests
Open Eclipse and create a new file with the name testng.xml. Add the following code to the said file
This xml file contains only one test inside a suite. This
contains the groups section defined by using the groups
tag as shown in the code. The run tag represents the
group that needs to be run. The include tag represents
the name of the group that needs to be executed.
A n n o t a t i o n s P r i o r i t i z a t i o n
R e p o r t
G e n e ra t i o n
P a r a l l e l
Te s t i n g
A s s e r t i o n sG r o u p i n g
M e t h o d
D e p e n d e n c y
D i s a b l i n g
Te s t C a s e s
www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING
HTML Reports In TestNG
We can obtain detailed HTML test reports using TestNG
All test reports are saved in the test-output folder in eclipse project directory
A n n o t a t i o n s P r i o r i t i z a t i o n
R e p o r t
G e n e ra t i o n
P a r a l l e l
Te s t i n g
A s s e r t i o n sG r o u p i n g
M e t h o d
D e p e n d e n c y
D i s a b l i n g
Te s t C a s e s
www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING
Course Details & Customer Reviews
Go to www.edureka.co/testing-with-selenium-webdriver
Get Edureka Certified in Selenium Today!
Radha Muthian says, “I learned Selenium WebDriver and the course
was very helpful to automate the Web Applications. The lifetime
access of classes helps a lot to refer back and download the codes.”
Vijay Krishnan says, “I have attended Selenium Web driver Certification with
Edureka. The trainer has explained all the concepts of the course in detail
manner which was very easy to understand. Worth for the money spent!!!!”
Tom Tully says, “I wanted to learn Selenium Webdriver in a live, real
course, not self paced, so there would be pressure on me to finish.
Edureka accomplished this at a price far lower than an in-person class,
and as far as I know they are the only internet class that has live lectures
on this subject. Teacher was very knowledgeable. I learned basic use of
Selenium. No problem with me being in US and teacher in India. They
have US 800 number.”
Suhas Kashyap says, “The online Course(Selenium Webdriver), which
I took from Edureka was interactive and also helped me to improve
my knowledge on selenium. Further helped me in changing the job as
well. Thanks Edureka Team... :).”
www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING

More Related Content

What's hot (20)

How to Write & Run a Test Case in Selenium | Selenium Tutorial | Selenium Tra...
How to Write & Run a Test Case in Selenium | Selenium Tutorial | Selenium Tra...How to Write & Run a Test Case in Selenium | Selenium Tutorial | Selenium Tra...
How to Write & Run a Test Case in Selenium | Selenium Tutorial | Selenium Tra...
Edureka!
 
Web application testing with Selenium
Web application testing with SeleniumWeb application testing with Selenium
Web application testing with Selenium
Kerry Buckley
 
BDD with Cucumber
BDD with CucumberBDD with Cucumber
BDD with Cucumber
Knoldus Inc.
 
An overview of selenium webdriver
An overview of selenium webdriverAn overview of selenium webdriver
An overview of selenium webdriver
Anuraj S.L
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
Aneesh Rangarajan
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - Introduction
Amr E. Mohamed
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
Naga Dinesh
 
Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using selenium
shreyas JC
 
TestNG Framework
TestNG Framework TestNG Framework
TestNG Framework
Levon Apreyan
 
TestNG Annotations in Selenium | Edureka
TestNG Annotations in Selenium | EdurekaTestNG Annotations in Selenium | Edureka
TestNG Annotations in Selenium | Edureka
Edureka!
 
Selenium
SeleniumSelenium
Selenium
Batch2016
 
QSpiders - Automation using Selenium
QSpiders - Automation using SeleniumQSpiders - Automation using Selenium
QSpiders - Automation using Selenium
Qspiders - Software Testing Training Institute
 
testng
testngtestng
testng
harithakannan
 
TestNG - The Next Generation of Unit Testing
TestNG - The Next Generation of Unit TestingTestNG - The Next Generation of Unit Testing
TestNG - The Next Generation of Unit Testing
Bethmi Gunasekara
 
Selenium
SeleniumSelenium
Selenium
Vladimir Soghoyan
 
Selenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And AnswersSelenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And Answers
Ajit Jadhav
 
What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...
What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...
What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...
Simplilearn
 
Data driven Automation Framework with Selenium
Data driven Automation Framework with Selenium Data driven Automation Framework with Selenium
Data driven Automation Framework with Selenium
Edureka!
 
Introduction to selenium
Introduction to seleniumIntroduction to selenium
Introduction to selenium
Archana Krushnan
 
Selenium Automation Framework
Selenium Automation  FrameworkSelenium Automation  Framework
Selenium Automation Framework
Mindfire Solutions
 
How to Write & Run a Test Case in Selenium | Selenium Tutorial | Selenium Tra...
How to Write & Run a Test Case in Selenium | Selenium Tutorial | Selenium Tra...How to Write & Run a Test Case in Selenium | Selenium Tutorial | Selenium Tra...
How to Write & Run a Test Case in Selenium | Selenium Tutorial | Selenium Tra...
Edureka!
 
Web application testing with Selenium
Web application testing with SeleniumWeb application testing with Selenium
Web application testing with Selenium
Kerry Buckley
 
BDD with Cucumber
BDD with CucumberBDD with Cucumber
BDD with Cucumber
Knoldus Inc.
 
An overview of selenium webdriver
An overview of selenium webdriverAn overview of selenium webdriver
An overview of selenium webdriver
Anuraj S.L
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - Introduction
Amr E. Mohamed
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
Naga Dinesh
 
Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using selenium
shreyas JC
 
TestNG Framework
TestNG Framework TestNG Framework
TestNG Framework
Levon Apreyan
 
TestNG Annotations in Selenium | Edureka
TestNG Annotations in Selenium | EdurekaTestNG Annotations in Selenium | Edureka
TestNG Annotations in Selenium | Edureka
Edureka!
 
Selenium
SeleniumSelenium
Selenium
Batch2016
 
TestNG - The Next Generation of Unit Testing
TestNG - The Next Generation of Unit TestingTestNG - The Next Generation of Unit Testing
TestNG - The Next Generation of Unit Testing
Bethmi Gunasekara
 
Selenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And AnswersSelenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And Answers
Ajit Jadhav
 
What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...
What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...
What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...
Simplilearn
 
Data driven Automation Framework with Selenium
Data driven Automation Framework with Selenium Data driven Automation Framework with Selenium
Data driven Automation Framework with Selenium
Edureka!
 
Introduction to selenium
Introduction to seleniumIntroduction to selenium
Introduction to selenium
Archana Krushnan
 
Selenium Automation Framework
Selenium Automation  FrameworkSelenium Automation  Framework
Selenium Automation Framework
Mindfire Solutions
 

Similar to Selenium Training | TestNG Framework For Selenium | Selenium Tutorial For Beginners | Edureka (20)

Selenium IDE Tutorial For Beginners | What Is Selenium IDE? | Selenium Tutori...
Selenium IDE Tutorial For Beginners | What Is Selenium IDE? | Selenium Tutori...Selenium IDE Tutorial For Beginners | What Is Selenium IDE? | Selenium Tutori...
Selenium IDE Tutorial For Beginners | What Is Selenium IDE? | Selenium Tutori...
Edureka!
 
TestNG Session presented in PB
TestNG Session presented in PBTestNG Session presented in PB
TestNG Session presented in PB
Abhishek Yadav
 
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Edureka!
 
Software Testing Tutorial For Beginners | Manual & Automation Testing | Selen...
Software Testing Tutorial For Beginners | Manual & Automation Testing | Selen...Software Testing Tutorial For Beginners | Manual & Automation Testing | Selen...
Software Testing Tutorial For Beginners | Manual & Automation Testing | Selen...
Edureka!
 
Selenium training in chennai
Selenium training in chennaiSelenium training in chennai
Selenium training in chennai
Thecreating Experts
 
Selenium Automation
Selenium AutomationSelenium Automation
Selenium Automation
Pratyush Majumdar
 
Test ng for testers
Test ng for testersTest ng for testers
Test ng for testers
Colombo Selenium Meetup
 
TestNG with selenium
TestNG with seleniumTestNG with selenium
TestNG with selenium
Gousalya Ramachandran
 
New selenium rc
New selenium rcNew selenium rc
New selenium rc
girichinna27
 
Selenium TestNG
Selenium TestNGSelenium TestNG
Selenium TestNG
KadarkaraiSelvam
 
Lesson_06_Software_and_Automation_Testing_Frameworks.pdf
Lesson_06_Software_and_Automation_Testing_Frameworks.pdfLesson_06_Software_and_Automation_Testing_Frameworks.pdf
Lesson_06_Software_and_Automation_Testing_Frameworks.pdf
Minh Quân Đoàn
 
TestNG introduction
TestNG introductionTestNG introduction
TestNG introduction
Denis Bazhin
 
Selenium using C# by Yogesh Kumar
Selenium using C# by  Yogesh KumarSelenium using C# by  Yogesh Kumar
Selenium using C# by Yogesh Kumar
Software Testing Board
 
Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...
Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...
Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...
Edureka!
 
Selenium Interview Questions and Answers For Freshers And Experienced | Edureka
Selenium Interview Questions and Answers For Freshers And Experienced | EdurekaSelenium Interview Questions and Answers For Freshers And Experienced | Edureka
Selenium Interview Questions and Answers For Freshers And Experienced | Edureka
Edureka!
 
TestNG
TestNGTestNG
TestNG
Prabhanshu Saraswat
 
Selenium
SeleniumSelenium
Selenium
Rakshitha Raviprakash
 
Selenium
SeleniumSelenium
Selenium
Batch2016
 
Selenium
SeleniumSelenium
Selenium
Batch2016
 
Selenium (1) (1)
Selenium (1) (1)Selenium (1) (1)
Selenium (1) (1)
Vishwan Aranha
 
Selenium IDE Tutorial For Beginners | What Is Selenium IDE? | Selenium Tutori...
Selenium IDE Tutorial For Beginners | What Is Selenium IDE? | Selenium Tutori...Selenium IDE Tutorial For Beginners | What Is Selenium IDE? | Selenium Tutori...
Selenium IDE Tutorial For Beginners | What Is Selenium IDE? | Selenium Tutori...
Edureka!
 
TestNG Session presented in PB
TestNG Session presented in PBTestNG Session presented in PB
TestNG Session presented in PB
Abhishek Yadav
 
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Edureka!
 
Software Testing Tutorial For Beginners | Manual & Automation Testing | Selen...
Software Testing Tutorial For Beginners | Manual & Automation Testing | Selen...Software Testing Tutorial For Beginners | Manual & Automation Testing | Selen...
Software Testing Tutorial For Beginners | Manual & Automation Testing | Selen...
Edureka!
 
Selenium training in chennai
Selenium training in chennaiSelenium training in chennai
Selenium training in chennai
Thecreating Experts
 
New selenium rc
New selenium rcNew selenium rc
New selenium rc
girichinna27
 
Lesson_06_Software_and_Automation_Testing_Frameworks.pdf
Lesson_06_Software_and_Automation_Testing_Frameworks.pdfLesson_06_Software_and_Automation_Testing_Frameworks.pdf
Lesson_06_Software_and_Automation_Testing_Frameworks.pdf
Minh Quân Đoàn
 
TestNG introduction
TestNG introductionTestNG introduction
TestNG introduction
Denis Bazhin
 
Selenium using C# by Yogesh Kumar
Selenium using C# by  Yogesh KumarSelenium using C# by  Yogesh Kumar
Selenium using C# by Yogesh Kumar
Software Testing Board
 
Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...
Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...
Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...
Edureka!
 
Selenium Interview Questions and Answers For Freshers And Experienced | Edureka
Selenium Interview Questions and Answers For Freshers And Experienced | EdurekaSelenium Interview Questions and Answers For Freshers And Experienced | Edureka
Selenium Interview Questions and Answers For Freshers And Experienced | Edureka
Edureka!
 
Selenium
SeleniumSelenium
Selenium
Batch2016
 
Selenium
SeleniumSelenium
Selenium
Batch2016
 
Selenium (1) (1)
Selenium (1) (1)Selenium (1) (1)
Selenium (1) (1)
Vishwan Aranha
 
Ad

More from Edureka! (20)

What to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaWhat to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | Edureka
Edureka!
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | Edureka
Edureka!
 
Top 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaTop 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | Edureka
Edureka!
 
Tableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaTableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | Edureka
Edureka!
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | Edureka
Edureka!
 
Top 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaTop 5 PMP Certifications | Edureka
Top 5 PMP Certifications | Edureka
Edureka!
 
Top Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaTop Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | Edureka
Edureka!
 
Linux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaLinux Mint Tutorial | Edureka
Linux Mint Tutorial | Edureka
Edureka!
 
How to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaHow to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| Edureka
Edureka!
 
Importance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaImportance of Digital Marketing | Edureka
Importance of Digital Marketing | Edureka
Edureka!
 
RPA in 2020 | Edureka
RPA in 2020 | EdurekaRPA in 2020 | Edureka
RPA in 2020 | Edureka
Edureka!
 
Email Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEmail Notifications in Jenkins | Edureka
Email Notifications in Jenkins | Edureka
Edureka!
 
EA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | Edureka
Edureka!
 
Cognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaCognitive AI Tutorial | Edureka
Cognitive AI Tutorial | Edureka
Edureka!
 
AWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaAWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | Edureka
Edureka!
 
Blue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaBlue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | Edureka
Edureka!
 
Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka
Edureka!
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Edureka!
 
Kubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaKubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | Edureka
Edureka!
 
Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | Edureka
Edureka!
 
What to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaWhat to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | Edureka
Edureka!
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | Edureka
Edureka!
 
Top 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaTop 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | Edureka
Edureka!
 
Tableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaTableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | Edureka
Edureka!
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | Edureka
Edureka!
 
Top 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaTop 5 PMP Certifications | Edureka
Top 5 PMP Certifications | Edureka
Edureka!
 
Top Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaTop Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | Edureka
Edureka!
 
Linux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaLinux Mint Tutorial | Edureka
Linux Mint Tutorial | Edureka
Edureka!
 
How to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaHow to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| Edureka
Edureka!
 
Importance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaImportance of Digital Marketing | Edureka
Importance of Digital Marketing | Edureka
Edureka!
 
RPA in 2020 | Edureka
RPA in 2020 | EdurekaRPA in 2020 | Edureka
RPA in 2020 | Edureka
Edureka!
 
Email Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEmail Notifications in Jenkins | Edureka
Email Notifications in Jenkins | Edureka
Edureka!
 
EA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | Edureka
Edureka!
 
Cognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaCognitive AI Tutorial | Edureka
Cognitive AI Tutorial | Edureka
Edureka!
 
AWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaAWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | Edureka
Edureka!
 
Blue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaBlue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | Edureka
Edureka!
 
Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka
Edureka!
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Edureka!
 
Kubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaKubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | Edureka
Edureka!
 
Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | Edureka
Edureka!
 
Ad

Recently uploaded (20)

How Insurance Policy Management Software Streamlines Operations
How Insurance Policy Management Software Streamlines OperationsHow Insurance Policy Management Software Streamlines Operations
How Insurance Policy Management Software Streamlines Operations
Insurance Tech Services
 
Essentials of Resource Planning in a Downturn
Essentials of Resource Planning in a DownturnEssentials of Resource Planning in a Downturn
Essentials of Resource Planning in a Downturn
OnePlan Solutions
 
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps CyclesFrom Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
Marjukka Niinioja
 
Providing Better Biodiversity Through Better Data
Providing Better Biodiversity Through Better DataProviding Better Biodiversity Through Better Data
Providing Better Biodiversity Through Better Data
Safe Software
 
wAIred_RabobankIgniteSession_12062025.pptx
wAIred_RabobankIgniteSession_12062025.pptxwAIred_RabobankIgniteSession_12062025.pptx
wAIred_RabobankIgniteSession_12062025.pptx
SimonedeGijt
 
dp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdfdp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdf
pravkumarbiz
 
The Future of Open Source Reporting Best Alternatives to Jaspersoft.pdf
The Future of Open Source Reporting Best Alternatives to Jaspersoft.pdfThe Future of Open Source Reporting Best Alternatives to Jaspersoft.pdf
The Future of Open Source Reporting Best Alternatives to Jaspersoft.pdf
Varsha Nayak
 
DevOps for AI: running LLMs in production with Kubernetes and KubeFlow
DevOps for AI: running LLMs in production with Kubernetes and KubeFlowDevOps for AI: running LLMs in production with Kubernetes and KubeFlow
DevOps for AI: running LLMs in production with Kubernetes and KubeFlow
Aarno Aukia
 
Leveraging Foundation Models to Infer Intents
Leveraging Foundation Models to Infer IntentsLeveraging Foundation Models to Infer Intents
Leveraging Foundation Models to Infer Intents
Keheliya Gallaba
 
GDG Douglas - Google AI Agents: Your Next Intern?
GDG Douglas - Google AI Agents: Your Next Intern?GDG Douglas - Google AI Agents: Your Next Intern?
GDG Douglas - Google AI Agents: Your Next Intern?
felipeceotto
 
Porting Qt 5 QML Modules to Qt 6 Webinar
Porting Qt 5 QML Modules to Qt 6 WebinarPorting Qt 5 QML Modules to Qt 6 Webinar
Porting Qt 5 QML Modules to Qt 6 Webinar
ICS
 
Shell Skill Tree - LabEx Certification (LabEx)
Shell Skill Tree - LabEx Certification (LabEx)Shell Skill Tree - LabEx Certification (LabEx)
Shell Skill Tree - LabEx Certification (LabEx)
VICTOR MAESTRE RAMIREZ
 
FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025
Safe Software
 
Migrating to Azure Cosmos DB the Right Way
Migrating to Azure Cosmos DB the Right WayMigrating to Azure Cosmos DB the Right Way
Migrating to Azure Cosmos DB the Right Way
Alexander (Alex) Komyagin
 
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Alluxio, Inc.
 
Marketo & Dynamics can be Most Excellent to Each Other – The Sequel
Marketo & Dynamics can be Most Excellent to Each Other – The SequelMarketo & Dynamics can be Most Excellent to Each Other – The Sequel
Marketo & Dynamics can be Most Excellent to Each Other – The Sequel
BradBedford3
 
Top 11 Fleet Management Software Providers in 2025 (2).pdf
Top 11 Fleet Management Software Providers in 2025 (2).pdfTop 11 Fleet Management Software Providers in 2025 (2).pdf
Top 11 Fleet Management Software Providers in 2025 (2).pdf
Trackobit
 
COBOL Programming with VSCode - IBM Certificate
COBOL Programming with VSCode - IBM CertificateCOBOL Programming with VSCode - IBM Certificate
COBOL Programming with VSCode - IBM Certificate
VICTOR MAESTRE RAMIREZ
 
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
Insurance Tech Services
 
IBM Rational Unified Process For Software Engineering - Introduction
IBM Rational Unified Process For Software Engineering - IntroductionIBM Rational Unified Process For Software Engineering - Introduction
IBM Rational Unified Process For Software Engineering - Introduction
Gaurav Sharma
 
How Insurance Policy Management Software Streamlines Operations
How Insurance Policy Management Software Streamlines OperationsHow Insurance Policy Management Software Streamlines Operations
How Insurance Policy Management Software Streamlines Operations
Insurance Tech Services
 
Essentials of Resource Planning in a Downturn
Essentials of Resource Planning in a DownturnEssentials of Resource Planning in a Downturn
Essentials of Resource Planning in a Downturn
OnePlan Solutions
 
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps CyclesFrom Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
Marjukka Niinioja
 
Providing Better Biodiversity Through Better Data
Providing Better Biodiversity Through Better DataProviding Better Biodiversity Through Better Data
Providing Better Biodiversity Through Better Data
Safe Software
 
wAIred_RabobankIgniteSession_12062025.pptx
wAIred_RabobankIgniteSession_12062025.pptxwAIred_RabobankIgniteSession_12062025.pptx
wAIred_RabobankIgniteSession_12062025.pptx
SimonedeGijt
 
dp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdfdp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdf
pravkumarbiz
 
The Future of Open Source Reporting Best Alternatives to Jaspersoft.pdf
The Future of Open Source Reporting Best Alternatives to Jaspersoft.pdfThe Future of Open Source Reporting Best Alternatives to Jaspersoft.pdf
The Future of Open Source Reporting Best Alternatives to Jaspersoft.pdf
Varsha Nayak
 
DevOps for AI: running LLMs in production with Kubernetes and KubeFlow
DevOps for AI: running LLMs in production with Kubernetes and KubeFlowDevOps for AI: running LLMs in production with Kubernetes and KubeFlow
DevOps for AI: running LLMs in production with Kubernetes and KubeFlow
Aarno Aukia
 
Leveraging Foundation Models to Infer Intents
Leveraging Foundation Models to Infer IntentsLeveraging Foundation Models to Infer Intents
Leveraging Foundation Models to Infer Intents
Keheliya Gallaba
 
GDG Douglas - Google AI Agents: Your Next Intern?
GDG Douglas - Google AI Agents: Your Next Intern?GDG Douglas - Google AI Agents: Your Next Intern?
GDG Douglas - Google AI Agents: Your Next Intern?
felipeceotto
 
Porting Qt 5 QML Modules to Qt 6 Webinar
Porting Qt 5 QML Modules to Qt 6 WebinarPorting Qt 5 QML Modules to Qt 6 Webinar
Porting Qt 5 QML Modules to Qt 6 Webinar
ICS
 
Shell Skill Tree - LabEx Certification (LabEx)
Shell Skill Tree - LabEx Certification (LabEx)Shell Skill Tree - LabEx Certification (LabEx)
Shell Skill Tree - LabEx Certification (LabEx)
VICTOR MAESTRE RAMIREZ
 
FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025
Safe Software
 
Migrating to Azure Cosmos DB the Right Way
Migrating to Azure Cosmos DB the Right WayMigrating to Azure Cosmos DB the Right Way
Migrating to Azure Cosmos DB the Right Way
Alexander (Alex) Komyagin
 
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Alluxio, Inc.
 
Marketo & Dynamics can be Most Excellent to Each Other – The Sequel
Marketo & Dynamics can be Most Excellent to Each Other – The SequelMarketo & Dynamics can be Most Excellent to Each Other – The Sequel
Marketo & Dynamics can be Most Excellent to Each Other – The Sequel
BradBedford3
 
Top 11 Fleet Management Software Providers in 2025 (2).pdf
Top 11 Fleet Management Software Providers in 2025 (2).pdfTop 11 Fleet Management Software Providers in 2025 (2).pdf
Top 11 Fleet Management Software Providers in 2025 (2).pdf
Trackobit
 
COBOL Programming with VSCode - IBM Certificate
COBOL Programming with VSCode - IBM CertificateCOBOL Programming with VSCode - IBM Certificate
COBOL Programming with VSCode - IBM Certificate
VICTOR MAESTRE RAMIREZ
 
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
Insurance Tech Services
 
IBM Rational Unified Process For Software Engineering - Introduction
IBM Rational Unified Process For Software Engineering - IntroductionIBM Rational Unified Process For Software Engineering - Introduction
IBM Rational Unified Process For Software Engineering - Introduction
Gaurav Sharma
 

Selenium Training | TestNG Framework For Selenium | Selenium Tutorial For Beginners | Edureka

  • 2. www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING What Will You Learn Today?  Limitations of Selenium WebDriver  No support for testing images  Not efficient Managing test cases  No support Report generation  Sikuli for testing images on the web  Annotating tests and managing test cases using TestNG  Generating HTML reports using TestNG
  • 3. www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING Sikuli & TestNG Are Used In Selenium WebDriver Because Of Its Limitations
  • 4. www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING Shortcomings Of Selenium WebDriver Dependency on external tools for Test management Images cannot be tested in Web applications Does not have Reporting facility
  • 5. www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING I have to verify the images that are present in the web page But, Selenium doesn’t support image based testing NOTE: Sikuli and Selenium can be integrated to also automate desktop applications Need To Do Image Based Testing
  • 6. www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING I have to verify the images that are present in the web page But, Selenium doesn’t support image based testing NOTE: Sikuli and Selenium can be integrated to also automate desktop applications Simple. Integrate Sikuli with Selenium for testing images Sikuli For Image Testing
  • 7. www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING Selenium + Sikuli Selenium Sikuli Image Testing + Web Testing
  • 8. www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING How Does Sikuli Work? • Uses image recognition techniques to test images visible on screen • It then performs operations on those images • Provides a GUI for scripting where screenshots/ images are sent as parameters “Automate anything you see on your screen ” -
  • 9. www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING Sikuli IDE • find • findAll • wait • waitVanish • exists Image Searching Commands • click • doubleClick • hover • dragDrop • rightClick Mouse Action Commands Image to be recognized Action to be performed
  • 10. www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING I have a very long code. Managing various Test cases is wearisome! Neither do I get detailed reports about those tests!! Other Limitations Of Selenium
  • 11. www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING I have a very long code. Managing various Test cases is wearisome! Neither do I get detailed reports about those tests!! Both the problems can be solved! Use TestNG in Selenium for Test management & Report generation TestNG To The Rescue
  • 12. www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING What Is TestNG? TestNG is an open source testing framework inspired by JUnit. It stands for Test Next Generation TestNG is more flexible & powerful than JUnit because of below functionalities: T e s t S c r i p t s T E S T R E P O R T S Prioritization Method Dependency Parallel Testing Assertions Disabling Test Cases GroupingAnnotations Report Generation
  • 13. www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING Advantages Of Using TestNG • HTML reports can be generated • Supports parallel testing • Test cases can be grouped & prioritized easily • Uses annotations for executing methods • Supports parameterization Note: Java is a pre-requisite for TestNG 1. Write the business logic of the test and insert TestNG annotations in the code 2. Add the information about your test (e.g. the class names, methods names, groups names etc.) in a testng.xml file or build.xml file 3. Run TestNG Steps for writing TestNG tests Advantages of using TestNG
  • 14. www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING Annotations In TestNG Annotations in TestNG are used to control the next method to be executed in the program TestNG programs will not have ‘main’ method. However, all methods will be annotated with ‘@’ Test methods – Primary methods to be executed Will be executed before both test method Will be executed after both test method A n n o t a t i o n s P r i o r i t i z a t i o n R e p o r t G e n e ra t i o n P a r a l l e l Te s t i n g A s s e r t i o n sG r o u p i n g M e t h o d D e p e n d e n c y D i s a b l i n g Te s t C a s e s
  • 15. www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING List Of Annotations In TestNG TESTNG ANNOTAIONS DESCRIPTION @BeforeSuite Annotated method will run before all the tests in the suite have run @AfterSuite Annotated method will run after all the tests in the suite have run @BeforeTest Annotated method will run before any test method belonging to the classes is run @AfterTest Annotated method will run after all the test methods belonging to the classes have run @BeforeGroup Annotated method will run before each group is run @AfterGroup Annotated method will run after every group is run @BeforeClass Annotated method will run once before the first test method in the current class is invoked @AfterClass Annotated method will run once after all the test methods in the current class have run @BeforeMethod Annotated method will run before any test method belonging to the classes is run @AfterMethod Annotated method will run after all the test methods belonging to the classes have run @Test Annotated method is a part of test A n n o t a t i o n s P r i o r i t i z a t i o n R e p o r t G e n e ra t i o n P a r a l l e l Te s t i n g A s s e r t i o n sG r o u p i n g M e t h o d D e p e n d e n c y D i s a b l i n g Te s t C a s e s
  • 16. www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING Examples Of Annotations In TestNG public class TestngAnnotation { @Test public void testCase1() { System.out.println("in test case 1"); } @BeforeMethod public void beforeMethod() { System.out.println("in beforeMethod"); } @AfterMethod public void afterMethod() { System.out.println("in afterMethod"); } @BeforeTest public void beforeTest() { System.out.println("in beforeTest"); } @AfterTest public void afterTest() { System.out.println("in afterTest"); } } Main method to be executed Will be executed before every test method Will be executed after every test method Will be executed before test Will be executed after test
  • 17. www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING Prioritization In TestNG Annotated methods can be prioritized in TestNG Priority can be assigned as parameters while calling the test cases If no priority is defined, then the test cases will be executed in alphabetical order Note: In this case, secondTest() will run first and then firstTest() will run A n n o t a t i o n s P r i o r i t i z a t i o n R e p o r t G e n e ra t i o n P a r a l l e l Te s t i n g A s s e r t i o n sG r o u p i n g M e t h o d D e p e n d e n c y D i s a b l i n g Te s t C a s e s
  • 18. www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING Method Dependency In TestNG Will execute only if finalTest() method passes A n n o t a t i o n s P r i o r i t i z a t i o n R e p o r t G e n e ra t i o n P a r a l l e l Te s t i n g A s s e r t i o n sG r o u p i n g M e t h o d D e p e n d e n c y D i s a b l i n g Te s t C a s e s In TestNG, we can use dependsOnMethods to implement dependency testing If the dependent method fails, then all the subsequent methods will be skipped
  • 19. www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING Always Running Tests In TestNG In TestNG, we can also choose to run a particular test irrespective of the fail/ pass condition of depending method We can control that by setting the alwaysRun attribute in @Test annotation; alwaysRun = true This test will run irrespective of finalTest() passing/ failing A n n o t a t i o n s P r i o r i t i z a t i o n R e p o r t G e n e ra t i o n P a r a l l e l Te s t i n g A s s e r t i o n sG r o u p i n g D i s a b l i n g Te s t C a s e s M e t h o d D e p e n d e n c y
  • 20. www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING Disabling Test Cases In TestNG, we can enable or disable test/ test cases as per needs We can control that by setting the enable attribute in @Test annotation; enabled=true or enabled=false This test will never be executed in the test case A n n o t a t i o n s P r i o r i t i z a t i o n R e p o r t G e n e ra t i o n P a r a l l e l Te s t i n g A s s e r t i o n sG r o u p i n g M e t h o d D e p e n d e n c y D i s a b l i n g Te s t C a s e s
  • 21. www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING Grouping Tests Into Test Cases In TestNG, we can categorize certain methods into groups Methods with same group name can be executed in one group We can control that by setting the group attribute in @Test annotation; groups={“xxx”} Note: A Test Case can belong to multiple test groups A n n o t a t i o n s P r i o r i t i z a t i o n R e p o r t G e n e ra t i o n P a r a l l e l Te s t i n g A s s e r t i o n sG r o u p i n g M e t h o d D e p e n d e n c y D i s a b l i n g Te s t C a s e s
  • 22. www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING Assertions In TestNG Assertions can be used in TestNG to compare the actual result with the expected result Check if both String 1 and String 2 are equal Check if call to aMethodCall() returns true Checks if driver.getTitle() returns vale as “Gmail” A n n o t a t i o n s P r i o r i t i z a t i o n R e p o r t G e n e ra t i o n P a r a l l e l Te s t i n g A s s e r t i o n sG r o u p i n g M e t h o d D e p e n d e n c y D i s a b l i n g Te s t C a s e s
  • 23. www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING Parallel Testing Using TestNG TestNG provides support for executing scripts in parallel, saving lot of time Multiple browser testing can be achieved as same scripts can be executed in multiple browser at the same time A n n o t a t i o n s P r i o r i t i z a t i o n R e p o r t G e n e ra t i o n P a r a l l e l Te s t i n g A s s e r t i o n sG r o u p i n g M e t h o d D e p e n d e n c y D i s a b l i n g Te s t C a s e s
  • 24. www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING Running A TestNG Group Of Tests Via testng.xml We can execute methods belonging to a group in TestNG, by creating testng.xml files Grouping is one of the annotations, used to execute multiple tests Open Eclipse and create a new file with the name testng.xml. Add the following code to the said file This xml file contains only one test inside a suite. This contains the groups section defined by using the groups tag as shown in the code. The run tag represents the group that needs to be run. The include tag represents the name of the group that needs to be executed. A n n o t a t i o n s P r i o r i t i z a t i o n R e p o r t G e n e ra t i o n P a r a l l e l Te s t i n g A s s e r t i o n sG r o u p i n g M e t h o d D e p e n d e n c y D i s a b l i n g Te s t C a s e s
  • 25. www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING HTML Reports In TestNG We can obtain detailed HTML test reports using TestNG All test reports are saved in the test-output folder in eclipse project directory A n n o t a t i o n s P r i o r i t i z a t i o n R e p o r t G e n e ra t i o n P a r a l l e l Te s t i n g A s s e r t i o n sG r o u p i n g M e t h o d D e p e n d e n c y D i s a b l i n g Te s t C a s e s
  • 26. www.edureka.co/testing-with-selenium-webdriverEDUREKA’S SELENIUM CERTIFICATION TRAINING Course Details & Customer Reviews Go to www.edureka.co/testing-with-selenium-webdriver Get Edureka Certified in Selenium Today! Radha Muthian says, “I learned Selenium WebDriver and the course was very helpful to automate the Web Applications. The lifetime access of classes helps a lot to refer back and download the codes.” Vijay Krishnan says, “I have attended Selenium Web driver Certification with Edureka. The trainer has explained all the concepts of the course in detail manner which was very easy to understand. Worth for the money spent!!!!” Tom Tully says, “I wanted to learn Selenium Webdriver in a live, real course, not self paced, so there would be pressure on me to finish. Edureka accomplished this at a price far lower than an in-person class, and as far as I know they are the only internet class that has live lectures on this subject. Teacher was very knowledgeable. I learned basic use of Selenium. No problem with me being in US and teacher in India. They have US 800 number.” Suhas Kashyap says, “The online Course(Selenium Webdriver), which I took from Edureka was interactive and also helped me to improve my knowledge on selenium. Further helped me in changing the job as well. Thanks Edureka Team... :).”

Editor's Notes

  • #13: InvocationCount Attributes
  • #27: Add photos