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
PPT
Testing Java Web Apps With Selenium
PPT
Selenium
PPTX
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
PPTX
Selenium ppt
PPTX
Selenium with java
PDF
Advanced Selenium Workshop
PDF
Selenium Tutorial
Selenium - Introduction
Testing Java Web Apps With Selenium
Selenium
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
Selenium ppt
Selenium with java
Advanced Selenium Workshop
Selenium Tutorial

What's hot (17)

PPT
Selenium2 and Jenkins: Almost pain-free UI Testing
PPTX
Introduction to Selenium Web Driver
PPT
selenium training | selenium course | selenium video tutorial | selenium for ...
PDF
San Jose Selenium Meet-up PushToTest TestMaker Presentation
PDF
Basics of Selenium IDE,Core, Remote Control
PDF
Automation Testing using Selenium
PPTX
Extreme Testing with Selenium - @hugs at Jenkins User Conference 2011
PPT
Selenium
PDF
How Gear4Music Went from 0-1000+ API Tests
PPTX
Smarter ways to do selenium automation @ work, Selenium, automation
PPTX
Selenium WebDriver training
PDF
Selenium With Spices
PDF
First steps with selenium rc
PDF
Creating selenium remote control tests
PDF
Selenium Automation Testing Interview Questions And Answers
DOCX
Selenium webdriver course content rakesh hansalia
PDF
Testing with Codeception
Selenium2 and Jenkins: Almost pain-free UI Testing
Introduction to Selenium Web Driver
selenium training | selenium course | selenium video tutorial | selenium for ...
San Jose Selenium Meet-up PushToTest TestMaker Presentation
Basics of Selenium IDE,Core, Remote Control
Automation Testing using Selenium
Extreme Testing with Selenium - @hugs at Jenkins User Conference 2011
Selenium
How Gear4Music Went from 0-1000+ API Tests
Smarter ways to do selenium automation @ work, Selenium, automation
Selenium WebDriver training
Selenium With Spices
First steps with selenium rc
Creating selenium remote control tests
Selenium Automation Testing Interview Questions And Answers
Selenium webdriver course content rakesh hansalia
Testing with Codeception
Ad

Viewers also liked (20)

PPTX
SAP OVERVIEW
PPT
Sap Interview Questions - Part 1
PPTX
SAP BASIS Training in Chennai
PPTX
SAP BASIS Training in Chennai Demo Part-3
PPT
101 erp605 process_overview_en_in
PPTX
SAP OVERVIEW
PPTX
SAP Overview and Architecture
PPT
sap basis
PDF
SAP BASIS ONLINE TRAINING MATERIAL by Keylabs
PPTX
SAP BASIS Training in Chennai Demo Part-6
PPTX
SAP BASIS Training in Chennai
PDF
Bn1033 demo sap basis
PPT
Sap Intro
PDF
Sap basis r3 hand book
PPT
Sap overview
DOC
SAP_Basis_Consultant_Bhushan Nalawade
PPT
Day1 Sap Basis Overview V1 1
DOC
SAP Basis Training Material | www.sapdocs.info
PDF
Sap basis certification_and_interview_questions_answers_and11237206714
PPT
SAP INTRO
SAP OVERVIEW
Sap Interview Questions - Part 1
SAP BASIS Training in Chennai
SAP BASIS Training in Chennai Demo Part-3
101 erp605 process_overview_en_in
SAP OVERVIEW
SAP Overview and Architecture
sap basis
SAP BASIS ONLINE TRAINING MATERIAL by Keylabs
SAP BASIS Training in Chennai Demo Part-6
SAP BASIS Training in Chennai
Bn1033 demo sap basis
Sap Intro
Sap basis r3 hand book
Sap overview
SAP_Basis_Consultant_Bhushan Nalawade
Day1 Sap Basis Overview V1 1
SAP Basis Training Material | www.sapdocs.info
Sap basis certification_and_interview_questions_answers_and11237206714
SAP INTRO
Ad

Similar to Selenium Training in Chennai (20)

PPT
Steps to write Selenium
PPT
Selenium training in chennai
PDF
Selenium by using JAVA
PDF
Getting Started with Selenium
PPTX
Selenium training
PDF
Lesson_06_Software_and_Automation_Testing_Frameworks.pdf
DOC
PPT
Selenium Basics by Quontra Solutions
PPTX
Selenium Testing
PPTX
Test automation using selenium
PDF
POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with P...
PPTX
jDriver Presentation
PDF
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
PDF
Selenium and JMeter
PDF
Selenium and JMeter Testing
PPTX
Automated Web Testing With Selenium
PPT
Selenium training in chennai
PPT
Selenium Training in Chennai
PPTX
Test automation proposal
Steps to write Selenium
Selenium training in chennai
Selenium by using JAVA
Getting Started with Selenium
Selenium training
Lesson_06_Software_and_Automation_Testing_Frameworks.pdf
Selenium Basics by Quontra Solutions
Selenium Testing
Test automation using selenium
POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with P...
jDriver Presentation
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
Selenium and JMeter
Selenium and JMeter Testing
Automated Web Testing With Selenium
Selenium training in chennai
Selenium Training in Chennai
Test automation proposal

More from Thecreating Experts (16)

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

Recently uploaded (20)

PDF
SOIL: Factor, Horizon, Process, Classification, Degradation, Conservation
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PDF
Trump Administration's workforce development strategy
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PPTX
Orientation - ARALprogram of Deped to the Parents.pptx
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
PDF
Indian roads congress 037 - 2012 Flexible pavement
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
History, Philosophy and sociology of education (1).pptx
PDF
What if we spent less time fighting change, and more time building what’s rig...
PDF
Classroom Observation Tools for Teachers
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PPTX
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
PPTX
Unit 4 Skeletal System.ppt.pptxopresentatiom
PDF
Weekly quiz Compilation Jan -July 25.pdf
SOIL: Factor, Horizon, Process, Classification, Degradation, Conservation
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Trump Administration's workforce development strategy
Paper A Mock Exam 9_ Attempt review.pdf.
Practical Manual AGRO-233 Principles and Practices of Natural Farming
Orientation - ARALprogram of Deped to the Parents.pptx
Supply Chain Operations Speaking Notes -ICLT Program
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
Indian roads congress 037 - 2012 Flexible pavement
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
History, Philosophy and sociology of education (1).pptx
What if we spent less time fighting change, and more time building what’s rig...
Classroom Observation Tools for Teachers
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
Unit 4 Skeletal System.ppt.pptxopresentatiom
Weekly quiz Compilation Jan -July 25.pdf

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/