SlideShare a Scribd company logo
1 of 16
Download to read offline
Selenium IDE
and Locators
Presenter:

Manu Parashar
12/24/2013
Mindfire Solutions
About Me:
Manu Parashar
Skills:

Automation: Selenium Webdriver, Selenium RC, QTP 11
Frameworks: Junit, Testng
PL: Java, C#

Connect Me:

LinkedIn: http://www.linkedin.com/in/parasharmanu

Google+: https://plus.google.com/110738751918785957229/

Contact Me:

Email: manup@mindfiresolutions.com/ manu.aug5@gmail.com
Skype: mfsi_manup

Presenter: Manu Parashar, Mindfire Solutions
Agenda
1.

Selenium IDE
Introduction to the IDE
IDE Installation
Features of IDE
Creating Test cases using Record feature
Executing Test cases using Play feature

2.

Locators
Types of Locators
Locating Techniques
Locators examples

Presenter: Manu Parashar, Mindfire Solutions
Recap
 What is Selenium?
 Features of Selenium?
 Tools under Selenium's Tool Suite?
 How Remote Control(RC) works?
 How Webdriver works?
 Features of Selenium IDE?
 Different types of Locators?

Presenter: Manu Parashar, Mindfire Solutions
Introduction to Selenium IDE
Integrated development environment for Selenium scripts.
Contains a context menu that allows to first select a UI element
from the browser’s current page and then select from a list of
Selenium commands with parameters pre-defined according to
the context of the selected UI element.
Includes the entire Selenium Core, allowing you to easily and
quickly record and play back tests in the actual environment that
they will run in.
It is not only a recording tool: it is a complete IDE. Either its
recording capability can be used, or scripts may be edited.

Presenter: Manu Parashar, Mindfire Solutions
IDE Installation
Selenium IDE is distributed as Firefox extension:






Go to the Selenium website (http://www.seleniumhq.org)
or Firefox add-ons website (http://addons.mozilla.org).
Download the latest release.
Follow the instructions and restart Firefox.
Selenium IDE is accessible from the ‘Tools’ Menu of
Firefox .

Presenter: Manu Parashar, Mindfire Solutions
Features of IDE









Easy-to-use Firefox plug-in
Easy record and playback
Intelligent field selection will use IDs, names, or
XPath as needed
Autocomplete for all common Selenium commands
Debugging feature with step-by-step and
breakpoints
Save tests as HTML, Ruby scripts, or any other
format
Option to automatically assert the title of every
page
Easy customization through plugins
Presenter: Manu Parashar, Mindfire Solutions
Creating Test Cases
Recording

During recording, Selenium-IDE will automatically insert
commands into your test case based on your actions.
Record button is ON by default

Adding Verifications and Asserts With the Context
Menu
Editing

Insert Command
Insert Comment
Edit a Command or Comment

Presenter: Manu Parashar, Mindfire Solutions
Executing Test Cases


Run a Test Case (clicking Run button)



Run a Test Suite (clicking Run All button)



Stop and Start (Pause/Resume button)



Stop in the Middle (Toggle Breakpoint option)



Start from the Middle (Set/Clear Start Point option)



Run Any Single Command (Double click)

Presenter: Manu Parashar, Mindfire Solutions
Selenese
Domain Specific Language(DSL) to write tests. Simple xHTML
tables of 3 columns and ‘n’ rows:
• A method on 1st column: the action to perform

• A locator on 2nd column: the subject of the method (ie: what

element is acted upon)
• A value on 3rd column: the value to be passed to the method
(what to type in a text field for instance)

Selenium commands that can be categorized as:

•Actions: commands that manipulate the state of application like

clicking links or buttons.
•Accessors: examine the state of the application and store values
in variables.
•Assertions: are like Accessors, but they verify that the state of
the application conforms to what is expected. Eg. “assert”,
“verify”, and ” waitFor”
Presenter: Manu Parashar, Mindfire Solutions
Locators
Attributes-based locators:

It relies on the attributes of the elements to locate them.

Identifier

Id

Name

Link

CSS

Structure-based locators:

It rely on the structure of the page to find elements.

DOM

XPath

CSS
Presenter: Manu Parashar, Mindfire Solutions
Locating Techniques

Presenter: Manu Parashar, Mindfire Solutions
Identifier: works with the id and name attributes of html tags.
Eg. identifier=loginForm, identifier=password

Id: more limited than the identifier locator, but more explicit.
Eg. id=loginForm

Name: locate the first element with a matching name attribute.
Eg. name=username, name=continue value=Clear

Link: locates a hyperlink by using the text of the link
Eg. link=Continue, link=Cancel

CSS: Selectors for binding style properties to elements in the
document
Eg. css=form#loginForm, css=input[name="username"],
css=input.required[type="text"], css=input.passfield,

Presenter: Manu Parashar, Mindfire Solutions
DOM: works by locating elements that matches the javascript
expression refering to an element in the DOM of the page.
Eg. dom=document.getElementById('loginForm'),
dom=document.forms['loginForm'], dom=document.forms[0],
document.forms[0].username, document.forms[0].elements[3]

Xpath: language used for locating nodes in an XML document.

Eg. xpath=/html/body/form[1]  - Absolute path (would break if
HTML was changed only slightly)
//form[1] (3) - First form element in the HTML
xpath=//form[@id='loginForm'] (3) - The form element with
attribute named ‘id’ and the value
‘loginForm’
//input[@name='username'] (4) - First input element with
attribute named ‘name’ and the value
‘username’
//form[@id='loginForm']/input[1] (4) - First input child
element of the form element with attribute
named ‘id’ and the value ‘loginForm’
Presenter: Manu Parashar, Mindfire Solutions
Questions
??

Presenter: Manu Parashar, Mindfire Solutions
Thank you

Presenter: Manu Parashar, Mindfire Solutions

More Related Content

What's hot

What's hot (20)

Locators in selenium - BNT 09
Locators in selenium - BNT 09Locators in selenium - BNT 09
Locators in selenium - BNT 09
 
TestNG - The Next Generation of Unit Testing
TestNG - The Next Generation of Unit TestingTestNG - The Next Generation of Unit Testing
TestNG - The Next Generation of Unit Testing
 
Selenium WebDriver
Selenium WebDriverSelenium WebDriver
Selenium WebDriver
 
Selenium WebDriver
Selenium WebDriverSelenium WebDriver
Selenium WebDriver
 
An overview of selenium webdriver
An overview of selenium webdriverAn overview of selenium webdriver
An overview of selenium webdriver
 
TestNG Framework
TestNG Framework TestNG Framework
TestNG Framework
 
Automation Testing by Selenium Web Driver
Automation Testing by Selenium Web DriverAutomation Testing by Selenium Web Driver
Automation Testing by Selenium Web Driver
 
Automation Testing using Selenium Webdriver
Automation Testing using Selenium WebdriverAutomation Testing using Selenium Webdriver
Automation Testing using Selenium Webdriver
 
Selenium- A Software Testing Tool
Selenium- A Software Testing ToolSelenium- A Software Testing Tool
Selenium- A Software Testing Tool
 
Automation Testing using Selenium
Automation Testing using SeleniumAutomation Testing using Selenium
Automation Testing using Selenium
 
SELENIUM PPT.pdf
SELENIUM PPT.pdfSELENIUM PPT.pdf
SELENIUM PPT.pdf
 
Setting up Page Object Model in Automation Framework
Setting up Page Object Model in Automation FrameworkSetting up Page Object Model in Automation Framework
Setting up Page Object Model in Automation Framework
 
Test Automation Using Python | Edureka
Test Automation Using Python | EdurekaTest Automation Using Python | Edureka
Test Automation Using Python | Edureka
 
Xpath in Selenium | Selenium Xpath Tutorial | Selenium Xpath Examples | Selen...
Xpath in Selenium | Selenium Xpath Tutorial | Selenium Xpath Examples | Selen...Xpath in Selenium | Selenium Xpath Tutorial | Selenium Xpath Examples | Selen...
Xpath in Selenium | Selenium Xpath Tutorial | Selenium Xpath Examples | Selen...
 
Test Automation and Selenium
Test Automation and SeleniumTest Automation and Selenium
Test Automation and Selenium
 
Automated Web Testing Using Selenium
Automated Web Testing Using SeleniumAutomated Web Testing Using Selenium
Automated Web Testing Using Selenium
 
Selenium Automation Framework
Selenium Automation  FrameworkSelenium Automation  Framework
Selenium Automation Framework
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 
testng
testngtestng
testng
 
Page Object Model and Implementation in Selenium
Page Object Model and Implementation in Selenium  Page Object Model and Implementation in Selenium
Page Object Model and Implementation in Selenium
 

Similar to Selenium IDE LOCATORS

Selenium rc ppt
Selenium rc pptSelenium rc ppt
Selenium rc ppt
mindqqa
 

Similar to Selenium IDE LOCATORS (20)

Test_Automation using Selenium.ppt
Test_Automation using Selenium.pptTest_Automation using Selenium.ppt
Test_Automation using Selenium.ppt
 
Karate _Framework.ppt
Karate _Framework.pptKarate _Framework.ppt
Karate _Framework.ppt
 
DSL, Page Object and Selenium – a way to reliable functional tests
DSL, Page Object and Selenium – a way to reliable functional testsDSL, Page Object and Selenium – a way to reliable functional tests
DSL, Page Object and Selenium – a way to reliable functional tests
 
Selenium training in pune course content advanto software
Selenium training in pune   course content advanto softwareSelenium training in pune   course content advanto software
Selenium training in pune course content advanto software
 
FluentSelenium Presentation Code Camp09
FluentSelenium Presentation Code Camp09FluentSelenium Presentation Code Camp09
FluentSelenium Presentation Code Camp09
 
Selenium rc ppt
Selenium rc pptSelenium rc ppt
Selenium rc ppt
 
selenium.ppt
selenium.pptselenium.ppt
selenium.ppt
 
selenium.ppt
selenium.pptselenium.ppt
selenium.ppt
 
selenium.ppt
selenium.pptselenium.ppt
selenium.ppt
 
Selenium IDE
Selenium IDESelenium IDE
Selenium IDE
 
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
 
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
 
The "Holy Grail" of Dev/Ops
The "Holy Grail" of Dev/OpsThe "Holy Grail" of Dev/Ops
The "Holy Grail" of Dev/Ops
 
Selenium course training institute ameerpet hyderabad
Selenium course training institute ameerpet hyderabadSelenium course training institute ameerpet hyderabad
Selenium course training institute ameerpet hyderabad
 
Selenium course training institute ameerpet hyderabad – Best software trainin...
Selenium course training institute ameerpet hyderabad – Best software trainin...Selenium course training institute ameerpet hyderabad – Best software trainin...
Selenium course training institute ameerpet hyderabad – Best software trainin...
 
SPCA2013 - Test-driven Development with SharePoint 2013 and Visual Studio
SPCA2013 - Test-driven Development with SharePoint 2013 and Visual StudioSPCA2013 - Test-driven Development with SharePoint 2013 and Visual Studio
SPCA2013 - Test-driven Development with SharePoint 2013 and Visual Studio
 
Web testing with Selenium
Web testing with SeleniumWeb testing with Selenium
Web testing with Selenium
 
The Professional Programmer
The Professional ProgrammerThe Professional Programmer
The Professional Programmer
 
Generative AI in CSharp with Semantic Kernel.pptx
Generative AI in CSharp with Semantic Kernel.pptxGenerative AI in CSharp with Semantic Kernel.pptx
Generative AI in CSharp with Semantic Kernel.pptx
 
VS 2010 codename Rosario
VS 2010 codename RosarioVS 2010 codename Rosario
VS 2010 codename Rosario
 

More from Mindfire Solutions

More from Mindfire Solutions (20)

Physician Search and Review
Physician Search and ReviewPhysician Search and Review
Physician Search and Review
 
diet management app
diet management appdiet management app
diet management app
 
Business Technology Solution
Business Technology SolutionBusiness Technology Solution
Business Technology Solution
 
Remote Health Monitoring
Remote Health MonitoringRemote Health Monitoring
Remote Health Monitoring
 
Influencer Marketing Solution
Influencer Marketing SolutionInfluencer Marketing Solution
Influencer Marketing Solution
 
ELMAH
ELMAHELMAH
ELMAH
 
High Availability of Azure Applications
High Availability of Azure ApplicationsHigh Availability of Azure Applications
High Availability of Azure Applications
 
IOT Hands On
IOT Hands OnIOT Hands On
IOT Hands On
 
Glimpse of Loops Vs Set
Glimpse of Loops Vs SetGlimpse of Loops Vs Set
Glimpse of Loops Vs Set
 
Oracle Sql Developer-Getting Started
Oracle Sql Developer-Getting StartedOracle Sql Developer-Getting Started
Oracle Sql Developer-Getting Started
 
Adaptive Layout In iOS 8
Adaptive Layout In iOS 8Adaptive Layout In iOS 8
Adaptive Layout In iOS 8
 
Introduction to Auto-layout : iOS/Mac
Introduction to Auto-layout : iOS/MacIntroduction to Auto-layout : iOS/Mac
Introduction to Auto-layout : iOS/Mac
 
LINQPad - utility Tool
LINQPad - utility ToolLINQPad - utility Tool
LINQPad - utility Tool
 
Get started with watch kit development
Get started with watch kit developmentGet started with watch kit development
Get started with watch kit development
 
Swift vs Objective-C
Swift vs Objective-CSwift vs Objective-C
Swift vs Objective-C
 
Material Design in Android
Material Design in AndroidMaterial Design in Android
Material Design in Android
 
Introduction to OData
Introduction to ODataIntroduction to OData
Introduction to OData
 
Ext js Part 2- MVC
Ext js Part 2- MVCExt js Part 2- MVC
Ext js Part 2- MVC
 
ExtJs Basic Part-1
ExtJs Basic Part-1ExtJs Basic Part-1
ExtJs Basic Part-1
 
Spring Security Introduction
Spring Security IntroductionSpring Security Introduction
Spring Security Introduction
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

Selenium IDE LOCATORS

  • 1. Selenium IDE and Locators Presenter: Manu Parashar 12/24/2013 Mindfire Solutions
  • 2. About Me: Manu Parashar Skills: Automation: Selenium Webdriver, Selenium RC, QTP 11 Frameworks: Junit, Testng PL: Java, C# Connect Me: LinkedIn: http://www.linkedin.com/in/parasharmanu Google+: https://plus.google.com/110738751918785957229/ Contact Me: Email: manup@mindfiresolutions.com/ manu.aug5@gmail.com Skype: mfsi_manup Presenter: Manu Parashar, Mindfire Solutions
  • 3. Agenda 1. Selenium IDE Introduction to the IDE IDE Installation Features of IDE Creating Test cases using Record feature Executing Test cases using Play feature 2. Locators Types of Locators Locating Techniques Locators examples Presenter: Manu Parashar, Mindfire Solutions
  • 4. Recap  What is Selenium?  Features of Selenium?  Tools under Selenium's Tool Suite?  How Remote Control(RC) works?  How Webdriver works?  Features of Selenium IDE?  Different types of Locators? Presenter: Manu Parashar, Mindfire Solutions
  • 5. Introduction to Selenium IDE Integrated development environment for Selenium scripts. Contains a context menu that allows to first select a UI element from the browser’s current page and then select from a list of Selenium commands with parameters pre-defined according to the context of the selected UI element. Includes the entire Selenium Core, allowing you to easily and quickly record and play back tests in the actual environment that they will run in. It is not only a recording tool: it is a complete IDE. Either its recording capability can be used, or scripts may be edited. Presenter: Manu Parashar, Mindfire Solutions
  • 6. IDE Installation Selenium IDE is distributed as Firefox extension:     Go to the Selenium website (http://www.seleniumhq.org) or Firefox add-ons website (http://addons.mozilla.org). Download the latest release. Follow the instructions and restart Firefox. Selenium IDE is accessible from the ‘Tools’ Menu of Firefox . Presenter: Manu Parashar, Mindfire Solutions
  • 7. Features of IDE         Easy-to-use Firefox plug-in Easy record and playback Intelligent field selection will use IDs, names, or XPath as needed Autocomplete for all common Selenium commands Debugging feature with step-by-step and breakpoints Save tests as HTML, Ruby scripts, or any other format Option to automatically assert the title of every page Easy customization through plugins Presenter: Manu Parashar, Mindfire Solutions
  • 8. Creating Test Cases Recording During recording, Selenium-IDE will automatically insert commands into your test case based on your actions. Record button is ON by default Adding Verifications and Asserts With the Context Menu Editing Insert Command Insert Comment Edit a Command or Comment Presenter: Manu Parashar, Mindfire Solutions
  • 9. Executing Test Cases  Run a Test Case (clicking Run button)  Run a Test Suite (clicking Run All button)  Stop and Start (Pause/Resume button)  Stop in the Middle (Toggle Breakpoint option)  Start from the Middle (Set/Clear Start Point option)  Run Any Single Command (Double click) Presenter: Manu Parashar, Mindfire Solutions
  • 10. Selenese Domain Specific Language(DSL) to write tests. Simple xHTML tables of 3 columns and ‘n’ rows: • A method on 1st column: the action to perform • A locator on 2nd column: the subject of the method (ie: what element is acted upon) • A value on 3rd column: the value to be passed to the method (what to type in a text field for instance) Selenium commands that can be categorized as: •Actions: commands that manipulate the state of application like clicking links or buttons. •Accessors: examine the state of the application and store values in variables. •Assertions: are like Accessors, but they verify that the state of the application conforms to what is expected. Eg. “assert”, “verify”, and ” waitFor” Presenter: Manu Parashar, Mindfire Solutions
  • 11. Locators Attributes-based locators: It relies on the attributes of the elements to locate them.  Identifier  Id  Name  Link  CSS Structure-based locators: It rely on the structure of the page to find elements.  DOM  XPath  CSS Presenter: Manu Parashar, Mindfire Solutions
  • 12. Locating Techniques Presenter: Manu Parashar, Mindfire Solutions
  • 13. Identifier: works with the id and name attributes of html tags. Eg. identifier=loginForm, identifier=password Id: more limited than the identifier locator, but more explicit. Eg. id=loginForm Name: locate the first element with a matching name attribute. Eg. name=username, name=continue value=Clear Link: locates a hyperlink by using the text of the link Eg. link=Continue, link=Cancel CSS: Selectors for binding style properties to elements in the document Eg. css=form#loginForm, css=input[name="username"], css=input.required[type="text"], css=input.passfield, Presenter: Manu Parashar, Mindfire Solutions
  • 14. DOM: works by locating elements that matches the javascript expression refering to an element in the DOM of the page. Eg. dom=document.getElementById('loginForm'), dom=document.forms['loginForm'], dom=document.forms[0], document.forms[0].username, document.forms[0].elements[3] Xpath: language used for locating nodes in an XML document. Eg. xpath=/html/body/form[1]  - Absolute path (would break if HTML was changed only slightly) //form[1] (3) - First form element in the HTML xpath=//form[@id='loginForm'] (3) - The form element with attribute named ‘id’ and the value ‘loginForm’ //input[@name='username'] (4) - First input element with attribute named ‘name’ and the value ‘username’ //form[@id='loginForm']/input[1] (4) - First input child element of the form element with attribute named ‘id’ and the value ‘loginForm’ Presenter: Manu Parashar, Mindfire Solutions
  • 16. Thank you Presenter: Manu Parashar, Mindfire Solutions