SlideShare a Scribd company logo
1 of 15
Object identification &
its management in
Selenium WebDriver
-VINAY KUMAR P
Object Identification
 For testing different applications i.e. Application Under Test (AUT), we need to
identify the object it is made of. It is consisting of different objects like below:
 Button
 Text Box
 Link
 Drop Down
 Radio Button
 List Box
 Slider
 Object identification is very important part of automation activity. So the
automation people should be able to identify the objects for automation purpose.
 For identifying these objects Selenium uses a concept of ‘Locators’. These locators
are used to identify the objects which are mostly used while automating the test
cases using Selenium.
 Locators: There are number of locators present. These are among them.
 ID
 Name
 XPath
 CSS
 Class
 tagName
 Link Text
 Filters
 Finding an element and confirming the expected result requires locators.
The 'By' class is used in WebDriver to locate the elements. These are as below:
Locator : ID
Syntax :-
By.id(id);
Locator : Name
Syntax :-
By.name(name);
Locator : Class
Syntax :-
By.class(class);
Locator : tagName
Syntax :-
By.tagName(name);
Locator : Link Text
Syntax :-
By.linkText(linkText);
Locator : CSS
Syntax :-
By.cssSelector(selector);
Locator : XPath
Syntax :-
By.xpath(xpath);
Locator : Filters
Syntax :-
By.partialLinkText(partialLinkTe
xt);
Different ways of writing the XPaths
 The following are different ways of writing the XPaths:-
 Based upon location: A node element can be identified based upon its Absolute or Relative
path.
 Absolute path :- it starts from the root element of the html code.
 //html/body/div[@id="WebPartWPQ2"]/div[1]/div[2]/div[1]/div[1]/div[5]
 Relative path :- it starts from a preceding string of the html code.
 //*[@id="lst-ib"]
 Based upon attributes
 Single
 //button[@id='gbqfba']
 Multiple
 //button[@id='gbqfba'] [@name=‘xyz]
 Based upon relative
 //div[@id='gbqfbwa']/button“
 Based upon position
 //div[2]/button
XPath Axes
Ancestor
To find nearest ancestor/
parent element that contains
an element that has an
attribute with a certain value
Syntax:-
//*[ancestor::foo[bar[@attr="v
al"]]]
Descendants
To find nearest Descendants/
child element that contains an
element that has an attribute
with a certain value
Syntax:-
//id('books')/descendant::td[@cl
ass='title']
following-sibling
To find all following sibling
element
Syntax:-
//ul/li[following-
sibling::li='roger']
Parent
Each element and attribute
has one parent
Syntax:-
//*[@class='bodywrapper']/pa
rent::*
Child
Child returns all the children in
the current node.
Syntax:-
//*[@class='sphinxsidebarwra
pper']/child::*
preceding-sibling
To find preceding sibling
element
Syntax:-
//ul/li[preceding-
sibling::li='bob' ]
XPath Axes
Self
To returns the current node.
Syntax:-
//*[@class='footer']/self::div
Attribute
It returns all the attributes in
the current node
Syntax:-
//*[@class='sphinxsidebarwra
pper']/attribute::*
following
Following returns all in the
document after the closing
tag of the current node.
Syntax:-
//*[@class='clearer']/following
::*
preceding
Preceding is a reverse of
Following; Preceding returns
all in the document before the
current node
Syntax:-
//*[@class='bodywrapper']/pr
eceding::*
Contains()
Contains() is a method used in XPath
expression. It is used when the value of
any attribute changes dynamically
The contain feature has an ability to find
the element with partial text
Syntax:-
//*[contains(@type,'sub')]
//*[contains(@name,'btn')]
//*[contains(text(),'here')]
//*[contains(@href,'guru99.com')]
Object Management
Object management
 Test automation predominantly revolves around GUI, objects i.e. various UI controls.
Ability of an automation tool to deal with objects is certainly important when selecting
an automation tool for your Application-Under-Test (AUT). At the same time, how you
look at using it for Object Management is just as important.
 Object Management is not mere object identification, but a lot more than that. The
following list will throw some light on what I mean:
 Object Identification – Tool algorithm used to identify objects – Name, ID, Link, XPath, etc. that
will work across browsers. Do I need technical skills to identify objects?
 Object Repository – Let me know when objects are added by other users to avoid relearning
and improve reusability
 Object Maintenance - Let me know when objects are added or removed within AUT for me
understand the impact of object change
Object identification
 Object identification, to be more precise, objects being identified
accurately demands certain steps to be followed and is certainly not a
straight forward experience in Selenium WebDriver.
 SELENIUM -WEBDRIVER offers a range of locators to point to a specific object
in AUT. To name a few – ID, Name, XPath, CSS, etc.
 There are tools such as Firebug that can provide a much deeper
understanding of the objects. The drawback here is that it demands
understanding of HTML DOM to help you decide how to deal with objects
to derive the best object identification locator.
Object repository
 Object repository is a collection of object and properties with which
automation tool will be able to recognize the objects and act on it.
 Having a centralized Object Repository is an absolute necessity for any test
automation initiative to be sustainable.
 In a multi-user environment, Object Repository reduces duplication of effort
involved in learning objects if another user has already defined those objects.
Only new or changed objects need to be dealt with. Most automation tools
would provide for some form of Object Repository.
 Selenium WebDriver offers no object repository implementation by default.
 Page object model help us to overcome the drawback of Selenium
WebDriver.
Object Maintenance
 A change in application can be introduction of new UI or change in existing UI. In
either of the case one must know which objects are already present in the
repository and which objects in AUT have undergone a change and require
update in Object Repository.
 Many are lost in this phase, ending up with relearning the objects / making
changes to object without knowing the impacted test cases. As a result you have
to maintain duplicate objects or you get unnecessary failures during execution.
 An automation tool that can help you understand the impact of any object
change would go a long way in addressing the headaches associated with Object
Management. For e.g.:
 Functionality that provides you a list of test cases that will be impacted by an object
change instantly will help faster decision-making and changes.
 Ability to update an object once and all test cases using that object are automatically
updated
 Most currently available tools provide this information post an execution failure –
basically.
Impact of Object Management on Automation ROI
 Object management that looks beyond the basics of object identification will
have a much larger impact on ROI from a test automation exercise.
Incomplete and under-utilized Object Management will have adverse
consequences such as:
 Productivity slows down
 Maintenance efforts increase
 Overall cost is increased as against anticipated savings
 Above all, readiness of automation suite is not guaranteed when required
 Suffice to say that Object Management needs a deeper thought and hence, it
is fair to conclude that Object Management mechanism cannot be taken
lightly when using Selenium WebDriver as your automation technology.
Thank you…

More Related Content

What's hot

Hibernate An Introduction
Hibernate An IntroductionHibernate An Introduction
Hibernate An IntroductionNguyen Cao
 
Introduction to JPA (JPA version 2.0)
Introduction to JPA (JPA version 2.0)Introduction to JPA (JPA version 2.0)
Introduction to JPA (JPA version 2.0)ejlp12
 
MVC and Entity Framework 4
MVC and Entity Framework 4MVC and Entity Framework 4
MVC and Entity Framework 4James Johnson
 
JQUERY TUTORIALS
JQUERY TUTORIALSJQUERY TUTORIALS
JQUERY TUTORIALSMoize Roxas
 
Hibernate Tutorial
Hibernate TutorialHibernate Tutorial
Hibernate TutorialRam132
 
Introduction to Hibernate Framework
Introduction to Hibernate FrameworkIntroduction to Hibernate Framework
Introduction to Hibernate FrameworkRaveendra R
 
07.3. Android Alert message, List, Dropdown, and Auto Complete
07.3. Android Alert message, List, Dropdown, and Auto Complete07.3. Android Alert message, List, Dropdown, and Auto Complete
07.3. Android Alert message, List, Dropdown, and Auto CompleteOum Saokosal
 
Hibernate complete Training
Hibernate complete TrainingHibernate complete Training
Hibernate complete Trainingsourabh aggarwal
 
Vaadin JPAContainer
Vaadin JPAContainerVaadin JPAContainer
Vaadin JPAContainercmkandemir
 
Introduction to hibernate
Introduction to hibernateIntroduction to hibernate
Introduction to hibernatehr1383
 
Back-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldBack-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldDavid McCarter
 
jQuery basics for Beginners
jQuery basics for BeginnersjQuery basics for Beginners
jQuery basics for BeginnersPooja Saxena
 

What's hot (19)

Hibernate An Introduction
Hibernate An IntroductionHibernate An Introduction
Hibernate An Introduction
 
Introduction to JPA (JPA version 2.0)
Introduction to JPA (JPA version 2.0)Introduction to JPA (JPA version 2.0)
Introduction to JPA (JPA version 2.0)
 
MVC and Entity Framework 4
MVC and Entity Framework 4MVC and Entity Framework 4
MVC and Entity Framework 4
 
Oop14
Oop14Oop14
Oop14
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
JQUERY TUTORIALS
JQUERY TUTORIALSJQUERY TUTORIALS
JQUERY TUTORIALS
 
Hibernate Tutorial
Hibernate TutorialHibernate Tutorial
Hibernate Tutorial
 
Real World MVC
Real World MVCReal World MVC
Real World MVC
 
Introduction to Hibernate Framework
Introduction to Hibernate FrameworkIntroduction to Hibernate Framework
Introduction to Hibernate Framework
 
07.3. Android Alert message, List, Dropdown, and Auto Complete
07.3. Android Alert message, List, Dropdown, and Auto Complete07.3. Android Alert message, List, Dropdown, and Auto Complete
07.3. Android Alert message, List, Dropdown, and Auto Complete
 
Introduction to JPA Framework
Introduction to JPA FrameworkIntroduction to JPA Framework
Introduction to JPA Framework
 
Easy mockppt
Easy mockpptEasy mockppt
Easy mockppt
 
Hibernate complete Training
Hibernate complete TrainingHibernate complete Training
Hibernate complete Training
 
Vaadin JPAContainer
Vaadin JPAContainerVaadin JPAContainer
Vaadin JPAContainer
 
Java persistence api 2.1
Java persistence api 2.1Java persistence api 2.1
Java persistence api 2.1
 
Introduction to hibernate
Introduction to hibernateIntroduction to hibernate
Introduction to hibernate
 
Back-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldBack-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real World
 
JPA For Beginner's
JPA For Beginner'sJPA For Beginner's
JPA For Beginner's
 
jQuery basics for Beginners
jQuery basics for BeginnersjQuery basics for Beginners
jQuery basics for Beginners
 

Viewers also liked

Qtp Object Identification
Qtp Object IdentificationQtp Object Identification
Qtp Object Identificationvirtualkey
 
Trabalho De Ingles
Trabalho De InglesTrabalho De Ingles
Trabalho De Inglesguesta66cf0
 
Hands-on Guide to Object Identification
Hands-on Guide to Object IdentificationHands-on Guide to Object Identification
Hands-on Guide to Object IdentificationDharmesh Vaya
 
Object Oriented Concept Static vs. Non Static
Object Oriented Concept Static vs. Non StaticObject Oriented Concept Static vs. Non Static
Object Oriented Concept Static vs. Non StaticAbdul Rahman Sherzad
 
Lecture 2 introduction to Software Engineering 1
Lecture 2   introduction to Software Engineering 1Lecture 2   introduction to Software Engineering 1
Lecture 2 introduction to Software Engineering 1IIUI
 
Software Engineering 2 lecture slide
Software Engineering 2 lecture slideSoftware Engineering 2 lecture slide
Software Engineering 2 lecture slideAdil Mehmoood
 
Object Oriented Concept
Object Oriented ConceptObject Oriented Concept
Object Oriented ConceptD Nayanathara
 
1-Introduction to Software Engineering (Object Oriented Software Engineering ...
1-Introduction to Software Engineering (Object Oriented Software Engineering ...1-Introduction to Software Engineering (Object Oriented Software Engineering ...
1-Introduction to Software Engineering (Object Oriented Software Engineering ...Hafiz Ammar Siddiqui
 
Object Modelling in Software Engineering
Object Modelling in Software EngineeringObject Modelling in Software Engineering
Object Modelling in Software Engineeringguest7fe55d5e
 
Object Oriented Concept
Object Oriented ConceptObject Oriented Concept
Object Oriented Conceptsmj
 
Software Engineering unit 2
Software Engineering unit 2Software Engineering unit 2
Software Engineering unit 2Abhimanyu Mishra
 
Jedi slides 2.1 object-oriented concepts
Jedi slides 2.1 object-oriented conceptsJedi slides 2.1 object-oriented concepts
Jedi slides 2.1 object-oriented conceptsMaryo Manjaruni
 
Object Oriented Software Engineering
Object Oriented Software EngineeringObject Oriented Software Engineering
Object Oriented Software EngineeringAli Haider
 
Object Oriented Design in Software Engineering SE12
Object Oriented Design in Software Engineering SE12Object Oriented Design in Software Engineering SE12
Object Oriented Design in Software Engineering SE12koolkampus
 
Pramod Kumar Behera
Pramod Kumar BeheraPramod Kumar Behera
Pramod Kumar BeheraPramod Kumar
 
Winwin love prezentace
Winwin love prezentaceWinwin love prezentace
Winwin love prezentacefashiontechcz
 
Javascript Exploitation
Javascript ExploitationJavascript Exploitation
Javascript ExploitationRashid feroz
 

Viewers also liked (20)

Qtp Object Identification
Qtp Object IdentificationQtp Object Identification
Qtp Object Identification
 
Trabalho De Ingles
Trabalho De InglesTrabalho De Ingles
Trabalho De Ingles
 
Hands-on Guide to Object Identification
Hands-on Guide to Object IdentificationHands-on Guide to Object Identification
Hands-on Guide to Object Identification
 
Object Oriented Concept Static vs. Non Static
Object Oriented Concept Static vs. Non StaticObject Oriented Concept Static vs. Non Static
Object Oriented Concept Static vs. Non Static
 
Lecture 2 introduction to Software Engineering 1
Lecture 2   introduction to Software Engineering 1Lecture 2   introduction to Software Engineering 1
Lecture 2 introduction to Software Engineering 1
 
Software Engineering 2 lecture slide
Software Engineering 2 lecture slideSoftware Engineering 2 lecture slide
Software Engineering 2 lecture slide
 
Object Oriented Concept
Object Oriented ConceptObject Oriented Concept
Object Oriented Concept
 
1-Introduction to Software Engineering (Object Oriented Software Engineering ...
1-Introduction to Software Engineering (Object Oriented Software Engineering ...1-Introduction to Software Engineering (Object Oriented Software Engineering ...
1-Introduction to Software Engineering (Object Oriented Software Engineering ...
 
Object Modelling in Software Engineering
Object Modelling in Software EngineeringObject Modelling in Software Engineering
Object Modelling in Software Engineering
 
Object Oriented Concept
Object Oriented ConceptObject Oriented Concept
Object Oriented Concept
 
Software Engineering unit 2
Software Engineering unit 2Software Engineering unit 2
Software Engineering unit 2
 
Jedi slides 2.1 object-oriented concepts
Jedi slides 2.1 object-oriented conceptsJedi slides 2.1 object-oriented concepts
Jedi slides 2.1 object-oriented concepts
 
Object Oriented Software Engineering
Object Oriented Software EngineeringObject Oriented Software Engineering
Object Oriented Software Engineering
 
Object Oriented Design in Software Engineering SE12
Object Oriented Design in Software Engineering SE12Object Oriented Design in Software Engineering SE12
Object Oriented Design in Software Engineering SE12
 
Pramod Kumar Behera
Pramod Kumar BeheraPramod Kumar Behera
Pramod Kumar Behera
 
Winwin love prezentace
Winwin love prezentaceWinwin love prezentace
Winwin love prezentace
 
Mani Resume
Mani ResumeMani Resume
Mani Resume
 
Javascript Exploitation
Javascript ExploitationJavascript Exploitation
Javascript Exploitation
 
Gamify Your Fundraiser
Gamify Your Fundraiser Gamify Your Fundraiser
Gamify Your Fundraiser
 
45b8e1ce2
45b8e1ce245b8e1ce2
45b8e1ce2
 

Similar to Object identification and its management

Design Summit - Navigating the ManageIQ Object Model - Brad Ascar
Design Summit - Navigating the ManageIQ Object Model - Brad AscarDesign Summit - Navigating the ManageIQ Object Model - Brad Ascar
Design Summit - Navigating the ManageIQ Object Model - Brad AscarManageIQ
 
Automated_Testing_Selenium
Automated_Testing_SeleniumAutomated_Testing_Selenium
Automated_Testing_SeleniumJagdish Kaushal
 
Generic Objects - Bill Wei - ManageIQ Design Summit 2016
Generic Objects - Bill Wei - ManageIQ Design Summit 2016Generic Objects - Bill Wei - ManageIQ Design Summit 2016
Generic Objects - Bill Wei - ManageIQ Design Summit 2016ManageIQ
 
Manageable Robust Automated Ui Test
Manageable Robust Automated Ui TestManageable Robust Automated Ui Test
Manageable Robust Automated Ui TestJohn.Jian.Fang
 
Automatedtestingwithselenium shubham jain
Automatedtestingwithselenium shubham jainAutomatedtestingwithselenium shubham jain
Automatedtestingwithselenium shubham jainPrashant Gurav
 
Object Oriented PHP - PART-1
Object Oriented PHP - PART-1Object Oriented PHP - PART-1
Object Oriented PHP - PART-1Jalpesh Vasa
 
How to use selenium locators effectively for web automation.pdf
How to use selenium locators effectively for web automation.pdfHow to use selenium locators effectively for web automation.pdf
How to use selenium locators effectively for web automation.pdfpcloudy2
 
2.business object repository
2.business object repository2.business object repository
2.business object repositoryAjay Kumar ☁
 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullySpringPeople
 
Web technology javascript
Web technology   javascriptWeb technology   javascript
Web technology javascriptUma mohan
 
Test automation with selenide
Test automation with selenideTest automation with selenide
Test automation with selenideIsuru Madanayaka
 
Using XPath in Selenium_ All you need to know.pdf
Using XPath in Selenium_ All you need to know.pdfUsing XPath in Selenium_ All you need to know.pdf
Using XPath in Selenium_ All you need to know.pdfRobertMartin69776
 
QTP Tutorial
QTP TutorialQTP Tutorial
QTP Tutorialpingkapil
 
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISE
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISEWINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISE
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISEHitesh Mohapatra
 
Testing APEX apps At A Glance
Testing APEX apps At A GlanceTesting APEX apps At A Glance
Testing APEX apps At A GlanceKai Donato
 
Java: Objects and Object References
Java: Objects and Object ReferencesJava: Objects and Object References
Java: Objects and Object ReferencesTareq Hasan
 
Qtp Training Deepti 2 Of 44780
Qtp Training Deepti 2 Of 44780Qtp Training Deepti 2 Of 44780
Qtp Training Deepti 2 Of 44780Azhar Satti
 

Similar to Object identification and its management (20)

Design Summit - Navigating the ManageIQ Object Model - Brad Ascar
Design Summit - Navigating the ManageIQ Object Model - Brad AscarDesign Summit - Navigating the ManageIQ Object Model - Brad Ascar
Design Summit - Navigating the ManageIQ Object Model - Brad Ascar
 
Automated_Testing_Selenium
Automated_Testing_SeleniumAutomated_Testing_Selenium
Automated_Testing_Selenium
 
Automation Testing by Selenium Web Driver
Automation Testing by Selenium Web DriverAutomation Testing by Selenium Web Driver
Automation Testing by Selenium Web Driver
 
Generic Objects - Bill Wei - ManageIQ Design Summit 2016
Generic Objects - Bill Wei - ManageIQ Design Summit 2016Generic Objects - Bill Wei - ManageIQ Design Summit 2016
Generic Objects - Bill Wei - ManageIQ Design Summit 2016
 
Manageable Robust Automated Ui Test
Manageable Robust Automated Ui TestManageable Robust Automated Ui Test
Manageable Robust Automated Ui Test
 
Automatedtestingwithselenium shubham jain
Automatedtestingwithselenium shubham jainAutomatedtestingwithselenium shubham jain
Automatedtestingwithselenium shubham jain
 
Object Oriented PHP - PART-1
Object Oriented PHP - PART-1Object Oriented PHP - PART-1
Object Oriented PHP - PART-1
 
How to use selenium locators effectively for web automation.pdf
How to use selenium locators effectively for web automation.pdfHow to use selenium locators effectively for web automation.pdf
How to use selenium locators effectively for web automation.pdf
 
Selenium Overview
Selenium OverviewSelenium Overview
Selenium Overview
 
2.business object repository
2.business object repository2.business object repository
2.business object repository
 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium Successfully
 
Web technology javascript
Web technology   javascriptWeb technology   javascript
Web technology javascript
 
Test automation with selenide
Test automation with selenideTest automation with selenide
Test automation with selenide
 
Using XPath in Selenium_ All you need to know.pdf
Using XPath in Selenium_ All you need to know.pdfUsing XPath in Selenium_ All you need to know.pdf
Using XPath in Selenium_ All you need to know.pdf
 
QTP Tutorial
QTP TutorialQTP Tutorial
QTP Tutorial
 
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISE
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISEWINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISE
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISE
 
Jquery library
Jquery libraryJquery library
Jquery library
 
Testing APEX apps At A Glance
Testing APEX apps At A GlanceTesting APEX apps At A Glance
Testing APEX apps At A Glance
 
Java: Objects and Object References
Java: Objects and Object ReferencesJava: Objects and Object References
Java: Objects and Object References
 
Qtp Training Deepti 2 Of 44780
Qtp Training Deepti 2 Of 44780Qtp Training Deepti 2 Of 44780
Qtp Training Deepti 2 Of 44780
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 

Recently uploaded (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

Object identification and its management

  • 1. Object identification & its management in Selenium WebDriver -VINAY KUMAR P
  • 3.  For testing different applications i.e. Application Under Test (AUT), we need to identify the object it is made of. It is consisting of different objects like below:  Button  Text Box  Link  Drop Down  Radio Button  List Box  Slider  Object identification is very important part of automation activity. So the automation people should be able to identify the objects for automation purpose.
  • 4.  For identifying these objects Selenium uses a concept of ‘Locators’. These locators are used to identify the objects which are mostly used while automating the test cases using Selenium.  Locators: There are number of locators present. These are among them.  ID  Name  XPath  CSS  Class  tagName  Link Text  Filters  Finding an element and confirming the expected result requires locators.
  • 5. The 'By' class is used in WebDriver to locate the elements. These are as below: Locator : ID Syntax :- By.id(id); Locator : Name Syntax :- By.name(name); Locator : Class Syntax :- By.class(class); Locator : tagName Syntax :- By.tagName(name); Locator : Link Text Syntax :- By.linkText(linkText); Locator : CSS Syntax :- By.cssSelector(selector); Locator : XPath Syntax :- By.xpath(xpath); Locator : Filters Syntax :- By.partialLinkText(partialLinkTe xt);
  • 6. Different ways of writing the XPaths  The following are different ways of writing the XPaths:-  Based upon location: A node element can be identified based upon its Absolute or Relative path.  Absolute path :- it starts from the root element of the html code.  //html/body/div[@id="WebPartWPQ2"]/div[1]/div[2]/div[1]/div[1]/div[5]  Relative path :- it starts from a preceding string of the html code.  //*[@id="lst-ib"]  Based upon attributes  Single  //button[@id='gbqfba']  Multiple  //button[@id='gbqfba'] [@name=‘xyz]  Based upon relative  //div[@id='gbqfbwa']/button“  Based upon position  //div[2]/button
  • 7. XPath Axes Ancestor To find nearest ancestor/ parent element that contains an element that has an attribute with a certain value Syntax:- //*[ancestor::foo[bar[@attr="v al"]]] Descendants To find nearest Descendants/ child element that contains an element that has an attribute with a certain value Syntax:- //id('books')/descendant::td[@cl ass='title'] following-sibling To find all following sibling element Syntax:- //ul/li[following- sibling::li='roger'] Parent Each element and attribute has one parent Syntax:- //*[@class='bodywrapper']/pa rent::* Child Child returns all the children in the current node. Syntax:- //*[@class='sphinxsidebarwra pper']/child::* preceding-sibling To find preceding sibling element Syntax:- //ul/li[preceding- sibling::li='bob' ]
  • 8. XPath Axes Self To returns the current node. Syntax:- //*[@class='footer']/self::div Attribute It returns all the attributes in the current node Syntax:- //*[@class='sphinxsidebarwra pper']/attribute::* following Following returns all in the document after the closing tag of the current node. Syntax:- //*[@class='clearer']/following ::* preceding Preceding is a reverse of Following; Preceding returns all in the document before the current node Syntax:- //*[@class='bodywrapper']/pr eceding::* Contains() Contains() is a method used in XPath expression. It is used when the value of any attribute changes dynamically The contain feature has an ability to find the element with partial text Syntax:- //*[contains(@type,'sub')] //*[contains(@name,'btn')] //*[contains(text(),'here')] //*[contains(@href,'guru99.com')]
  • 10. Object management  Test automation predominantly revolves around GUI, objects i.e. various UI controls. Ability of an automation tool to deal with objects is certainly important when selecting an automation tool for your Application-Under-Test (AUT). At the same time, how you look at using it for Object Management is just as important.  Object Management is not mere object identification, but a lot more than that. The following list will throw some light on what I mean:  Object Identification – Tool algorithm used to identify objects – Name, ID, Link, XPath, etc. that will work across browsers. Do I need technical skills to identify objects?  Object Repository – Let me know when objects are added by other users to avoid relearning and improve reusability  Object Maintenance - Let me know when objects are added or removed within AUT for me understand the impact of object change
  • 11. Object identification  Object identification, to be more precise, objects being identified accurately demands certain steps to be followed and is certainly not a straight forward experience in Selenium WebDriver.  SELENIUM -WEBDRIVER offers a range of locators to point to a specific object in AUT. To name a few – ID, Name, XPath, CSS, etc.  There are tools such as Firebug that can provide a much deeper understanding of the objects. The drawback here is that it demands understanding of HTML DOM to help you decide how to deal with objects to derive the best object identification locator.
  • 12. Object repository  Object repository is a collection of object and properties with which automation tool will be able to recognize the objects and act on it.  Having a centralized Object Repository is an absolute necessity for any test automation initiative to be sustainable.  In a multi-user environment, Object Repository reduces duplication of effort involved in learning objects if another user has already defined those objects. Only new or changed objects need to be dealt with. Most automation tools would provide for some form of Object Repository.  Selenium WebDriver offers no object repository implementation by default.  Page object model help us to overcome the drawback of Selenium WebDriver.
  • 13. Object Maintenance  A change in application can be introduction of new UI or change in existing UI. In either of the case one must know which objects are already present in the repository and which objects in AUT have undergone a change and require update in Object Repository.  Many are lost in this phase, ending up with relearning the objects / making changes to object without knowing the impacted test cases. As a result you have to maintain duplicate objects or you get unnecessary failures during execution.  An automation tool that can help you understand the impact of any object change would go a long way in addressing the headaches associated with Object Management. For e.g.:  Functionality that provides you a list of test cases that will be impacted by an object change instantly will help faster decision-making and changes.  Ability to update an object once and all test cases using that object are automatically updated  Most currently available tools provide this information post an execution failure – basically.
  • 14. Impact of Object Management on Automation ROI  Object management that looks beyond the basics of object identification will have a much larger impact on ROI from a test automation exercise. Incomplete and under-utilized Object Management will have adverse consequences such as:  Productivity slows down  Maintenance efforts increase  Overall cost is increased as against anticipated savings  Above all, readiness of automation suite is not guaranteed when required  Suffice to say that Object Management needs a deeper thought and hence, it is fair to conclude that Object Management mechanism cannot be taken lightly when using Selenium WebDriver as your automation technology.