SlideShare a Scribd company logo
By Creating Experts
Contact-8122241286
http://thecreatingexperts.com/selenium-training-in-chennai/
Sessions, Parallel run and Dependency in Selenium
Why do we need Session Handling?
• During test execution, the Selenium WebDriver has to interact with the browser all the time to
execute given commands. At the time of execution, it is also possible that, before current
execution completes, someone else starts execution of another script ,in the same machine
and in the same type of browser.
• In such situation, we need a mechanism by which our two different executions should not
overlap with each other. This can be achieved using Session Handling in Selenium.
How to achieve Session Handling in Selenium WebDriver?
• If you check the source code of Selenium WebDriver, you will find a variable named as
'sessionId'. Whenever we create a new instance of WebDriver object, a new 'sessionId' will
be generated and attached with that particular Firefox/Chrome/IE Driver ().
Handling Date Time Picker using Selenium
For DateTime selection, HTML5 has a new of control.
• If we see the DOM of the DateTime Picker control, there will be only one input box for both
date , time.
• So to handle this type of control first we will fill date with separating with delimiter, i.e. if date
is 09/25/2013, then we will pass 09252013 to the input box. Once done, we will shift focus
from date to time by pressing 'tab' & fill time.
• If we need to fill 02:45 PM , we will pass it a '0245PM' to the same input box.
Using Apache Ant with Selenium
What is Apache Ant?
• While creating a complete software product, one needs to take care different third party API,
their classpath, cleaning previous executable binary files, compiling our source code,
execution of source code, creation of reports and deployment code base etc. If these tasks
are done one by one manually, it will take an enormous time, and the process will be prone
to errors.
• Here comes the importance of a build tool like Ant. It stores, executes and automates all
process in a sequential order mentioned in Ant's configuration file (usually build.xml).
• Benefit of Ant build
• Ant creates the application life cycle i.e. clean, compile, set dependency, execute, report, etc.
• Third party API dependency can be set by Ant i.e. other Jar file's class path is set by Ant
build file.
• A complete application is created for End to End delivery and deployment.
• It is a simple build tool where all configurations can be done using XML file and which can be
executed from the command line.
• It makes your code clean as configuration is separate from actual application logic.
How to install Ant
Step 1) Go to http://ant.apache.org/bindownload.cgi Download .zip file from apache-ant-1.9.4-
bin.zip
Step 2) Unzip the folder and go to and copy path to the root of unzipped folder
Step 3) Go to Start -> Computer -> right click here and select 'Properties' then click on
Advanced System Settings
Step 4) A new window opens. Click on 'Environment Variable…' button.
Step 5) Click 'New…' button and set variable name as 'ANT_HOME' and variable value as the
root path to unzipped folder and click OK.
Step 6) now select 'Path' variable from the list and click 'Edit' and append; %ANT_HOME%bin.
Step 7) To check the version of your Ant using command line
Log4j and LogExpert with Selenium Tutorial
Introduction Log4j
• Log4j is a fast, flexible and reliable logging framework (APIS) written in Java developed in
early 1996. It is distributed under the Apache Software License. Log4J has been ported to
the C, C++, C#, Perl, Python, Ruby and Eiffel Languages. It is a tool used for small to large
scale Selenium Automation projects.
Why use Log4j?
• It is an open source
• With Log4j, it is possible to store the flow details of our Selenium Automation in a file or
databases
• Log4j is used for large as well as small projects
• In Log4j, we use log statements rather than SOPL statements in the code to know the status
of a project while it is executing
Log4j has three principal components
• Loggers: It is responsible for logging information. To implement loggers into a project
• Appenders: It is used to deliver LogEvents to their destination. It decides what will happen
with log information. In simple words, it is used to write the logs in file.
• Layouts: It is responsible for formatting logging information in different styles.
Steps to use Log4j with Selenium
Step 1) In Eclipse create a new project with name log4j_demo
Step 2) Right click on src -> Build Path -> Configure Build Path
Step 2) Click on Librariries and Add Log4J Lirabry. You can download it from
https://logging.apache.org/log4j/1.2/download.html
Step 3) Create a new file. This file will include all the log4j configuration
• Right click on src -> New -> Other -> General -> File
• Give the file name as "log4j.properties"
• Click on Finish
Step 4) In log4j.properties copy the entire configuration.
Step 5) Create main class:
• Right click on default package -> New -> Class
• Give the class name and click on finish
Step 6) Copy the following code in to the main class
Step 7) Run the script. Open the location of Manual and Selenium logs to check logging data.
Maven & Jenkins with Selenium: Complete Tutorial
What is Jenkins?
• Jenkins is the leading open-source continuous integration tool developed by Hudson lab. It is
cross-platform and can be used on Windows, Linux, Mac OS and Solaris environments.
• Jenkins is written in Java. Jenkin's chief usage is to monitor any job which can be SVN
checkout, cron or any application states. It fires pre-configured actions when a particular step
occurs in jobs.
Important Features of Jenkins
• Why Jenkins and Selenium?
• Steps to use install Maven and use it with TestNG Selenium
• Steps to Install Jenkins and configure it to Run Maven with TestNg Selenium
• Scheduling Jenkins for automatic execution.
• Jenkins with TestNg
• Benefits of Jenkins
Steps to use install Maven and use it with TestNG Selenium
Step1) In Eclipse IDE, select Help | Install New Software from Eclipse Main Menu.
Step 2) On the Install dialog, select Work with and m2e plugin
Step 3)Click on Next button and finish installation.
Configure Eclipse with Maven
With m2e plugin is installed, we now need create Maven project.
Step 1) In Eclipse IDE, create a new project by selecting File | New | Other from Eclipse menu.
Step 2) On the New dialog, select Maven | Maven Project and click Next
Step 3) On the New Maven Project dialog select the Create a simple project and click Next
Step 4) Enter WebdriverTest in Group Id: and Artifact Id: and click finish
Step 5) Eclipse will create WebdriverTest
Step 6) Right-click on JRE System Library and select the Properties option from the menu.
Step 7) Select pom.xml from Project Explorer..
Step 8).Add the Selenium and TestNG, JUnit dependencies to pom.xml in the <project> node
Step 9) Create a New TestNG Class. Enter Package name as "example" and "NewTest" in the
Name: textbox and click on the Finish button
Step 10). Eclipse will create the NewTest class
Step 11) Add the following code to the NewTest class
Step 12) Right-click on the WebdriverTest and select TestNG | Convert to TestNG.
Eclipse will create testng.xml which says that you need to run only one test with the name
NewTest
Step 13) Now you need to run test through this testng.xml.
Step 14). Additionally, we need to add
• maven-compiler-plugin
• maven-surefire-plugin
• testng.xml
Step 15) To run the tests in the Maven lifecycle, Right-click on the WebdriverTest and select
Run As | Maven test. Maven will execute test from the project.
Conclusion
• In this presentation, I have given the introduction of webdriver and explained
about Advance stuff of selenium in webdriver.
• Further topics will be expain in nest presentation.
• If you are interested to join in the training reach us-8122241286
• Visit us-http://thecreatingexperts.com/selenium-training-in-chennai/

More Related Content

PDF
Selenium - Introduction
Amr E. Mohamed
 
PPT
Testing Java Web Apps With Selenium
Marakana Inc.
 
PPT
Selenium
shrialinda
 
PPTX
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
Agile Testing Alliance
 
PPTX
Selenium ppt
Aneesh Rangarajan
 
PPTX
Selenium with java
Satyam Pandey
 
PDF
Advanced Selenium Workshop
Clever Moe
 
PDF
Selenium Tutorial
prad_123
 
Selenium - Introduction
Amr E. Mohamed
 
Testing Java Web Apps With Selenium
Marakana Inc.
 
Selenium
shrialinda
 
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
Agile Testing Alliance
 
Selenium ppt
Aneesh Rangarajan
 
Selenium with java
Satyam Pandey
 
Advanced Selenium Workshop
Clever Moe
 
Selenium Tutorial
prad_123
 

What's hot (17)

PPT
Selenium2 and Jenkins: Almost pain-free UI Testing
mikereedell
 
PPTX
Introduction to Selenium Web Driver
Return on Intelligence
 
PPT
selenium training | selenium course | selenium video tutorial | selenium for ...
Nancy Thomas
 
PDF
San Jose Selenium Meet-up PushToTest TestMaker Presentation
Clever Moe
 
PDF
Basics of Selenium IDE,Core, Remote Control
usha kannappan
 
PDF
Automation Testing using Selenium
Naresh Chintalcheru
 
PPTX
Extreme Testing with Selenium - @hugs at Jenkins User Conference 2011
hugs
 
PPT
Selenium
Sun Technlogies
 
PDF
How Gear4Music Went from 0-1000+ API Tests
Postman
 
PPTX
Smarter ways to do selenium automation @ work, Selenium, automation
RIA RUI Society
 
PPTX
Selenium WebDriver training
Vijay Krishnan Ramaswamy
 
PDF
Selenium With Spices
Nikolajs Okunevs
 
PDF
First steps with selenium rc
Dang Nguyen
 
PDF
Creating selenium remote control tests
Dang Nguyen
 
PDF
Selenium Automation Testing Interview Questions And Answers
Ajit Jadhav
 
DOCX
Selenium webdriver course content rakesh hansalia
Rakesh Hansalia
 
PDF
Testing with Codeception
Jeremy Coates
 
Selenium2 and Jenkins: Almost pain-free UI Testing
mikereedell
 
Introduction to Selenium Web Driver
Return on Intelligence
 
selenium training | selenium course | selenium video tutorial | selenium for ...
Nancy Thomas
 
San Jose Selenium Meet-up PushToTest TestMaker Presentation
Clever Moe
 
Basics of Selenium IDE,Core, Remote Control
usha kannappan
 
Automation Testing using Selenium
Naresh Chintalcheru
 
Extreme Testing with Selenium - @hugs at Jenkins User Conference 2011
hugs
 
Selenium
Sun Technlogies
 
How Gear4Music Went from 0-1000+ API Tests
Postman
 
Smarter ways to do selenium automation @ work, Selenium, automation
RIA RUI Society
 
Selenium WebDriver training
Vijay Krishnan Ramaswamy
 
Selenium With Spices
Nikolajs Okunevs
 
First steps with selenium rc
Dang Nguyen
 
Creating selenium remote control tests
Dang Nguyen
 
Selenium Automation Testing Interview Questions And Answers
Ajit Jadhav
 
Selenium webdriver course content rakesh hansalia
Rakesh Hansalia
 
Testing with Codeception
Jeremy Coates
 
Ad

Viewers also liked (20)

PPTX
SAP OVERVIEW
SRITHARAN V
 
PPT
Sap Interview Questions - Part 1
ReKruiTIn.com
 
PPTX
SAP BASIS Training in Chennai
Thecreating Experts
 
PPTX
SAP BASIS Training in Chennai Demo Part-3
Thecreating Experts
 
PPT
101 erp605 process_overview_en_in
satishkr14
 
PPTX
SAP OVERVIEW
SRITHARAN V
 
PPTX
SAP Overview and Architecture
Ankit Sharma
 
PPT
sap basis
Ashwani Yadav
 
PDF
SAP BASIS ONLINE TRAINING MATERIAL by Keylabs
keylabstraining
 
PPTX
SAP BASIS Training in Chennai Demo Part-6
Thecreating Experts
 
PPTX
SAP BASIS Training in Chennai
Thecreating Experts
 
PDF
Bn1033 demo sap basis
conline training
 
PPT
Sap Intro
neerajmal
 
PDF
Sap basis r3 hand book
nanda nanda
 
PPT
Sap overview
Raj p
 
DOC
SAP_Basis_Consultant_Bhushan Nalawade
Bhushan Nalawade
 
PPT
Day1 Sap Basis Overview V1 1
Guang Ying Yuan
 
DOC
SAP Basis Training Material | www.sapdocs.info
sapdocs. info
 
PDF
Sap basis certification_and_interview_questions_answers_and11237206714
ramesh469
 
PPT
SAP INTRO
Dr.Ravi
 
SAP OVERVIEW
SRITHARAN V
 
Sap Interview Questions - Part 1
ReKruiTIn.com
 
SAP BASIS Training in Chennai
Thecreating Experts
 
SAP BASIS Training in Chennai Demo Part-3
Thecreating Experts
 
101 erp605 process_overview_en_in
satishkr14
 
SAP OVERVIEW
SRITHARAN V
 
SAP Overview and Architecture
Ankit Sharma
 
sap basis
Ashwani Yadav
 
SAP BASIS ONLINE TRAINING MATERIAL by Keylabs
keylabstraining
 
SAP BASIS Training in Chennai Demo Part-6
Thecreating Experts
 
SAP BASIS Training in Chennai
Thecreating Experts
 
Bn1033 demo sap basis
conline training
 
Sap Intro
neerajmal
 
Sap basis r3 hand book
nanda nanda
 
Sap overview
Raj p
 
SAP_Basis_Consultant_Bhushan Nalawade
Bhushan Nalawade
 
Day1 Sap Basis Overview V1 1
Guang Ying Yuan
 
SAP Basis Training Material | www.sapdocs.info
sapdocs. info
 
Sap basis certification_and_interview_questions_answers_and11237206714
ramesh469
 
SAP INTRO
Dr.Ravi
 
Ad

Similar to Selenium Training in Chennai (20)

PPT
Steps to write Selenium
Rohit Thakur
 
PPT
Selenium training in chennai
Thecreating Experts
 
PDF
Selenium by using JAVA
mahirayavarapu
 
PDF
Getting Started with Selenium
Dave Haeffner
 
PPTX
Selenium training
Shivaraj R
 
PDF
Lesson_06_Software_and_Automation_Testing_Frameworks.pdf
Minh Quân Đoàn
 
DOC
Sel
Sandeep A R
 
PPT
Selenium Basics by Quontra Solutions
QUONTRASOLUTIONS
 
PPTX
Selenium Testing
Shreshtt Bhatt
 
PPTX
Test automation using selenium
Tờ Rang
 
PDF
POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with P...
Postman
 
PPTX
jDriver Presentation
freelancer_testautomation
 
PDF
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
jamescantor38
 
PDF
Selenium and JMeter
ArchanaKalapgar
 
PDF
Selenium and JMeter Testing
ArchanaKalapgar
 
PPTX
Automated Web Testing With Selenium
Jodie Miners
 
PPT
Selenium training in chennai
Thecreating Experts
 
PPT
Selenium Training in Chennai
Thecreating Experts
 
PPTX
Test automation proposal
Mihai-Cristian Fratila
 
Steps to write Selenium
Rohit Thakur
 
Selenium training in chennai
Thecreating Experts
 
Selenium by using JAVA
mahirayavarapu
 
Getting Started with Selenium
Dave Haeffner
 
Selenium training
Shivaraj R
 
Lesson_06_Software_and_Automation_Testing_Frameworks.pdf
Minh Quân Đoàn
 
Selenium Basics by Quontra Solutions
QUONTRASOLUTIONS
 
Selenium Testing
Shreshtt Bhatt
 
Test automation using selenium
Tờ Rang
 
POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with P...
Postman
 
jDriver Presentation
freelancer_testautomation
 
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
jamescantor38
 
Selenium and JMeter
ArchanaKalapgar
 
Selenium and JMeter Testing
ArchanaKalapgar
 
Automated Web Testing With Selenium
Jodie Miners
 
Selenium training in chennai
Thecreating Experts
 
Selenium Training in Chennai
Thecreating Experts
 
Test automation proposal
Mihai-Cristian Fratila
 

More from Thecreating Experts (16)

PPTX
Selenium Training in Chennai Demo Part-2
Thecreating Experts
 
PPTX
SAP BASIS Training in Chennai Demo Part-7
Thecreating Experts
 
PPTX
SAP SD Training in Chennai Demo Part-4
Thecreating Experts
 
PPTX
SAP MM Training in Chennai Demo Part-5
Thecreating Experts
 
PPTX
SAP HR Training in Chennai Demo Part-4
Thecreating Experts
 
PPTX
SAP SD Training in Chennai Demo Part-3
Thecreating Experts
 
PPTX
SAP HR Training in Chennai Demo Part-3
Thecreating Experts
 
PPTX
SAP BASIS Training in Chennai Demo Part-5
Thecreating Experts
 
PPTX
SAP HR Training in Chennai Demo Part-1
Thecreating Experts
 
PPTX
SAP BASIS Training in Chennai Demo Part-4
Thecreating Experts
 
PPTX
SAP SD Training in Chennai Demo Part-2
Thecreating Experts
 
PPTX
SAP SD Training in Chennai
Thecreating Experts
 
PPTX
SAP MM Training in Chennai Demo Part-2
Thecreating Experts
 
PPTX
SAP MM Training in Chennai
Thecreating Experts
 
PPTX
SAP HR Training in Chennai
Thecreating Experts
 
PPTX
SAP HR Training in Chennai
Thecreating Experts
 
Selenium Training in Chennai Demo Part-2
Thecreating Experts
 
SAP BASIS Training in Chennai Demo Part-7
Thecreating Experts
 
SAP SD Training in Chennai Demo Part-4
Thecreating Experts
 
SAP MM Training in Chennai Demo Part-5
Thecreating Experts
 
SAP HR Training in Chennai Demo Part-4
Thecreating Experts
 
SAP SD Training in Chennai Demo Part-3
Thecreating Experts
 
SAP HR Training in Chennai Demo Part-3
Thecreating Experts
 
SAP BASIS Training in Chennai Demo Part-5
Thecreating Experts
 
SAP HR Training in Chennai Demo Part-1
Thecreating Experts
 
SAP BASIS Training in Chennai Demo Part-4
Thecreating Experts
 
SAP SD Training in Chennai Demo Part-2
Thecreating Experts
 
SAP SD Training in Chennai
Thecreating Experts
 
SAP MM Training in Chennai Demo Part-2
Thecreating Experts
 
SAP MM Training in Chennai
Thecreating Experts
 
SAP HR Training in Chennai
Thecreating Experts
 
SAP HR Training in Chennai
Thecreating Experts
 

Recently uploaded (20)

PPTX
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
PPTX
Care of patients with elImination deviation.pptx
AneetaSharma15
 
DOCX
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
PDF
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
PPTX
How to Track Skills & Contracts Using Odoo 18 Employee
Celine George
 
PPTX
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
PPTX
How to Apply for a Job From Odoo 18 Website
Celine George
 
PPTX
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
PPTX
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
PPTX
PROTIEN ENERGY MALNUTRITION: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
PPTX
BASICS IN COMPUTER APPLICATIONS - UNIT I
suganthim28
 
PDF
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
PPTX
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
PPTX
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
PDF
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
DOCX
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
PPTX
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
PDF
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
PPTX
Command Palatte in Odoo 18.1 Spreadsheet - Odoo Slides
Celine George
 
PPTX
Artificial Intelligence in Gastroentrology: Advancements and Future Presprec...
AyanHossain
 
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
Care of patients with elImination deviation.pptx
AneetaSharma15
 
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
How to Track Skills & Contracts Using Odoo 18 Employee
Celine George
 
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
How to Apply for a Job From Odoo 18 Website
Celine George
 
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
PROTIEN ENERGY MALNUTRITION: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
BASICS IN COMPUTER APPLICATIONS - UNIT I
suganthim28
 
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
Command Palatte in Odoo 18.1 Spreadsheet - Odoo Slides
Celine George
 
Artificial Intelligence in Gastroentrology: Advancements and Future Presprec...
AyanHossain
 

Selenium Training in Chennai

  • 2. Sessions, Parallel run and Dependency in Selenium Why do we need Session Handling? • During test execution, the Selenium WebDriver has to interact with the browser all the time to execute given commands. At the time of execution, it is also possible that, before current execution completes, someone else starts execution of another script ,in the same machine and in the same type of browser. • In such situation, we need a mechanism by which our two different executions should not overlap with each other. This can be achieved using Session Handling in Selenium. How to achieve Session Handling in Selenium WebDriver? • If you check the source code of Selenium WebDriver, you will find a variable named as 'sessionId'. Whenever we create a new instance of WebDriver object, a new 'sessionId' will be generated and attached with that particular Firefox/Chrome/IE Driver ().
  • 3. Handling Date Time Picker using Selenium For DateTime selection, HTML5 has a new of control. • If we see the DOM of the DateTime Picker control, there will be only one input box for both date , time. • So to handle this type of control first we will fill date with separating with delimiter, i.e. if date is 09/25/2013, then we will pass 09252013 to the input box. Once done, we will shift focus from date to time by pressing 'tab' & fill time. • If we need to fill 02:45 PM , we will pass it a '0245PM' to the same input box.
  • 4. Using Apache Ant with Selenium What is Apache Ant? • While creating a complete software product, one needs to take care different third party API, their classpath, cleaning previous executable binary files, compiling our source code, execution of source code, creation of reports and deployment code base etc. If these tasks are done one by one manually, it will take an enormous time, and the process will be prone to errors. • Here comes the importance of a build tool like Ant. It stores, executes and automates all process in a sequential order mentioned in Ant's configuration file (usually build.xml).
  • 5. • Benefit of Ant build • Ant creates the application life cycle i.e. clean, compile, set dependency, execute, report, etc. • Third party API dependency can be set by Ant i.e. other Jar file's class path is set by Ant build file. • A complete application is created for End to End delivery and deployment. • It is a simple build tool where all configurations can be done using XML file and which can be executed from the command line. • It makes your code clean as configuration is separate from actual application logic.
  • 6. How to install Ant Step 1) Go to http://ant.apache.org/bindownload.cgi Download .zip file from apache-ant-1.9.4- bin.zip Step 2) Unzip the folder and go to and copy path to the root of unzipped folder Step 3) Go to Start -> Computer -> right click here and select 'Properties' then click on Advanced System Settings Step 4) A new window opens. Click on 'Environment Variable…' button. Step 5) Click 'New…' button and set variable name as 'ANT_HOME' and variable value as the root path to unzipped folder and click OK. Step 6) now select 'Path' variable from the list and click 'Edit' and append; %ANT_HOME%bin. Step 7) To check the version of your Ant using command line
  • 7. Log4j and LogExpert with Selenium Tutorial Introduction Log4j • Log4j is a fast, flexible and reliable logging framework (APIS) written in Java developed in early 1996. It is distributed under the Apache Software License. Log4J has been ported to the C, C++, C#, Perl, Python, Ruby and Eiffel Languages. It is a tool used for small to large scale Selenium Automation projects. Why use Log4j? • It is an open source • With Log4j, it is possible to store the flow details of our Selenium Automation in a file or databases • Log4j is used for large as well as small projects • In Log4j, we use log statements rather than SOPL statements in the code to know the status of a project while it is executing
  • 8. Log4j has three principal components • Loggers: It is responsible for logging information. To implement loggers into a project • Appenders: It is used to deliver LogEvents to their destination. It decides what will happen with log information. In simple words, it is used to write the logs in file. • Layouts: It is responsible for formatting logging information in different styles. Steps to use Log4j with Selenium Step 1) In Eclipse create a new project with name log4j_demo Step 2) Right click on src -> Build Path -> Configure Build Path Step 2) Click on Librariries and Add Log4J Lirabry. You can download it from https://logging.apache.org/log4j/1.2/download.html
  • 9. Step 3) Create a new file. This file will include all the log4j configuration • Right click on src -> New -> Other -> General -> File • Give the file name as "log4j.properties" • Click on Finish Step 4) In log4j.properties copy the entire configuration. Step 5) Create main class: • Right click on default package -> New -> Class • Give the class name and click on finish Step 6) Copy the following code in to the main class Step 7) Run the script. Open the location of Manual and Selenium logs to check logging data.
  • 10. Maven & Jenkins with Selenium: Complete Tutorial What is Jenkins? • Jenkins is the leading open-source continuous integration tool developed by Hudson lab. It is cross-platform and can be used on Windows, Linux, Mac OS and Solaris environments. • Jenkins is written in Java. Jenkin's chief usage is to monitor any job which can be SVN checkout, cron or any application states. It fires pre-configured actions when a particular step occurs in jobs. Important Features of Jenkins • Why Jenkins and Selenium? • Steps to use install Maven and use it with TestNG Selenium • Steps to Install Jenkins and configure it to Run Maven with TestNg Selenium • Scheduling Jenkins for automatic execution. • Jenkins with TestNg • Benefits of Jenkins
  • 11. Steps to use install Maven and use it with TestNG Selenium Step1) In Eclipse IDE, select Help | Install New Software from Eclipse Main Menu. Step 2) On the Install dialog, select Work with and m2e plugin Step 3)Click on Next button and finish installation. Configure Eclipse with Maven With m2e plugin is installed, we now need create Maven project. Step 1) In Eclipse IDE, create a new project by selecting File | New | Other from Eclipse menu. Step 2) On the New dialog, select Maven | Maven Project and click Next Step 3) On the New Maven Project dialog select the Create a simple project and click Next Step 4) Enter WebdriverTest in Group Id: and Artifact Id: and click finish
  • 12. Step 5) Eclipse will create WebdriverTest Step 6) Right-click on JRE System Library and select the Properties option from the menu. Step 7) Select pom.xml from Project Explorer.. Step 8).Add the Selenium and TestNG, JUnit dependencies to pom.xml in the <project> node Step 9) Create a New TestNG Class. Enter Package name as "example" and "NewTest" in the Name: textbox and click on the Finish button Step 10). Eclipse will create the NewTest class Step 11) Add the following code to the NewTest class
  • 13. Step 12) Right-click on the WebdriverTest and select TestNG | Convert to TestNG. Eclipse will create testng.xml which says that you need to run only one test with the name NewTest Step 13) Now you need to run test through this testng.xml. Step 14). Additionally, we need to add • maven-compiler-plugin • maven-surefire-plugin • testng.xml Step 15) To run the tests in the Maven lifecycle, Right-click on the WebdriverTest and select Run As | Maven test. Maven will execute test from the project.
  • 14. Conclusion • In this presentation, I have given the introduction of webdriver and explained about Advance stuff of selenium in webdriver. • Further topics will be expain in nest presentation. • If you are interested to join in the training reach us-8122241286 • Visit us-http://thecreatingexperts.com/selenium-training-in-chennai/