SlideShare a Scribd company logo
SELENIUM
INTRODUCTION 
 Selenium is a suite of tools used for browser 
automation 
 A well organized tool to develop test cases or test 
suites 
 Jason Huggins introduced selenium in 2004 
 It is developed using java scripts 
 It composed of 4 main components 
IDE, Remote Control, Web Driver and Grid 
 A tool to test the web based applications
What it can do? 
 Selenium can test in three regards 
1. Functional 
2. Regression and 
3. Load Testing
THE TECHNICAL CHALLENGES IN SELENIUM 
 Selenium Supports only web based applications 
 It doesn’t support any non web based (Like Win 32, Java Applet, Java Swing, 
.Net Client Server etc) applications 
 When you compare selenium with QTP, Silk Test, Test Partner and RFT, there 
are many challenges in terms of maintainability of the test cases 
 Since Selenium is a freeware tool, there is no direct support if one is in trouble 
with the support of applications 
 There is no object repository concept in Selenium, so maintainability of the 
objects is very high 
 There are many challenges if one have to interact with Win 32 windows even 
when you are working with Web based applications 
 Bitmap comparison is not supported by Selenium 
 Any reporting related capabilities, you need to depend on third party tools 
 You need to learn any one of the native language like (.Net, Java, Perl, Python, 
PHP, Ruby) to work efficiently with the scripting side of selenium.
FLEXIBILITY IN SELENIUM 
 Selenium testing suite is highly flexible. 
 There are multiple ways to add functionality to Selenium 
framework to customize test automation. 
 As compared to other test automation tools, it is Selenium’s 
strongest characteristic. 
 Selenium Remote Control support for multiple 
programming and scripting languages allows the test 
automation engineer to build any logic they need into their 
automated testing and to use a preferred programming or 
scripting language of one’s choice. 
 Also, the Selenium testing suite is an open source project 
where code can be modified and enhancements can be 
submitted for contribution
SELENIUM - IDE 
 Also known as SIDE 
 Helps the developer and tester in a easier way to drive 
the browser in a work flow 
 It is developed with java script 
 It is an Add-on in Mozilla Firefox browser, hence ide 
can work only for FF browser 
 It can export the recorded test cases to webdriver and 
which can runs in many languages like Perl, Php, Java, 
Ruby, C#, Phyton etc.. 
 Functional testing tool
FEATURES - IDE 
 Record or play back features 
 Debugging step by step and breakpoints 
 Page abstraction functionality 
 User extension that expands the functionality of SIDE
ADVANTAGE - IDE 
 Open source tool 
 Easy to install 
 Well organized in developing test cases 
 Exports test cases to many languages and which can be 
used in RC or Web Driver 
 Allows simple DOM- LEVEL testing at the same time it is 
used for traditional water fall model to modern Agile 
methodology 
 Records – Click, typing and other actions to make test 
cases 
 Auto complete for all common Selenium commands 
 Debug and set breakpoints
DISADVANTAGE - IDE 
 Dreary error diagnostics 
 Tests only web applications 
 IDE works with Mozilla Firefox browser only
SELENESE 
 A HTML language to drive the elements in the browser 
 There are three types 
1. Action 
2. Assertion 
3. Accessors 
Action - is used to perform an action or interaction 
with the elements. Eg: open, click, type etc. 
Assertion – to verify or assert the expected value based 
on optional or mandatory 
Accessors – To store a value in a variable
Assertion 
 Assert – If the expected value is matched if continues 
the next test steps. If not it aborts the test. Assert is 
used for the mandatory check. 
Note: While in a test suite it will abort the current test 
case and continue the next test case. 
 Verify – If the expected value is matched if continues 
the next test steps. If not the test execution will 
continue with the remaining steps. Verify is used for 
the optional check.
Accessors 
 To store a value in a variable 
a. To get a value from an element and compare it with the 
dynamic variable 
b. To take logical decisions to execute the test steps 
c. To execute the loops based on the value it returns
Basic Working of SIDE 
SIDE tool components 
Record and play back feature 
Assertions 
Multiple windows and Ajax 
Debugging
Where to get the SIDE 
 Visit http://docs.seleniumhq.org/ 
 Download tab 
 Selenium IDE version 2.5.0 
 You should have installed Mozilla FireFox browser 
 Since it’s a add-on for firefox 
 Once installed go to Tool Selenium IDE 
(or) 
 In the toolbar you can find Selenium IDE icon
SELENIUM IDE TOOL
1. SIDE components 
 Base URL: All open command will be relative to the base 
URL (full path). This is the URL that the test will start at. 
 Speed Slider: This slider is used to fast or slow mode 
during the play back. 
 (Triangle with 3 lines): Run all the tests in the id 
 (Triangle with 1 line): Run only single test 
 (||): Pause a test that is currently running 
 (bended down arrow): Step through the test once it has 
paused 
 Red button- This is the Record button. By default when 
we open the selenium IDE it will be enabled
Cont.. 
 Command - It is a select box has a list of all the 
commands that are needed to create the test. It is an auto 
complete functionality or use the drop down. 
 Target - the location of the element 
 Value - where you place the value that needs to be change. 
 Table view – Will keep track all the commands, targets 
and values. 
 Source View – You will be able to see the HTML that will 
store the test 
 Log – will show what is happening during the test run. 
 Reference – Documentation on the command highlighted
2. Record and Play back 
 Open Mozilla Firefox browser and Selenium IDE 
 By default the record mode is on 
 Write the URL in the Base Url 
 Now what ever you do in the browser those will be 
recorded in the SIDE 
 Once done stop recording and playback it 
 It will play you back the same action what u have done 
during recording.
3. Assertion 
 Assertion is a check point or verification point to verify 
 The two types are ASSERT and VERIFY 
 While recording when you right on any element you 
could find it in the show all available command 
assert and verify. 
 While playback it is going to verify the select action 
 The verified command will be glowing dark green in 
color.
Pattern Matching 
 The pattern matching is plays a vital role in when we 
use verify and assert 
 The three major types of pattern matching are 
1. GLOBBING 
2. EXACT 
3. REGULAR EXPRESSION 
 Globbing is handled with ? and * - glob: 
 Exact is used to match the exact word – exact: 
 Regular expression is used with the keyword regexp:
Examples… 
 While you verify or assert in the value specify the 
pattern match 
Eg: word id cool which is a dynamically changing 
element like pool, mool and fool 
Value - glob: ?ool 
Which accepts any alphabet in the ?’s space 
 Exact is the exact word match 
Eg: 
Value – exact: cool 
Which accepts only cool.
Regular expression 
 Consider this example 
2011-05-02451 
In value - regexp:[0-9]{4}-[0-9]{2}-[0-9]{5,10} 
So, 2011 all numeric and have 4 char so [0-9]{4} 
If a text is there: hi this is Selenium 
In Value : [a-z]{2} for hi 
[A-Z][a-z]{7}  Selenium 
Or [A-Z].* Selenium 
* Will accept the remaining alphabets.
4. Multiple window and AJAX 
1. As we test a page in the same way we can test all the 
elements on a another page 
 When we click the link for multiple window it may 
take time to load the page in the different window at 
that time we need to tell selenium to wait using the 
command “click and wait” 
2. Ajax is going to load the action at the same page 
 Selenium do not know when does it load? At this time 
we need to use “wait for the element”
Multiple windows 
 Open the IDE 
 Launch http://theautomatedtester.co.uk/ 
 Click on Chapter 1 
 Click on the element “Click this to launch another 
window” 
 A small window will appear where you can even verify 
the text.
Ajax 
 Open the IDE 
 Launch http://theautomatedtester.co.uk/ 
 Click on Chapter 1 
 Click on the element “Click this link to load a page 
with AJAX” 
 On the same page ajax action will be loaded and we 
can verify the text
5. Debugging 
 It is not necessary to test the whole test cases 
 We can debug the single or particular command 
whether it is working as expected 
 Three types of debugging 
1. Double click on the command 
2. Right click on the command and select execute this 
command or Click on the command press “X” 
3. Toggle breakpoint press ‘B’ on the command 
Note: while debugging make sure the browser is opened 
with the URL you are testing
Accessors 
 How to store value in a variable? 
1. Open the IDE and launch the site : 
http://book.theautomatedtester.co.uk/Chapter1 
2. Right click on any text that you need to store in the text box available 
in the page 
3. Select store Text 
4. A dialog box will appear and ask you to enter the name of the variable 
5. Enter a variable name eg: abc 
6. Now stop recording 
7. Click on the next blank step where the steps are recording 
8. Command: Type 
9. Target: storeinput //{which the id of the textbox} 
10. Value: ${abc} 
11. Now run the test 
12. You can view the selected text in the text box.
How it works? 
 We are recording and playing it back fine but how does it 
works or how does it verify the particular element in the 
page? 
 The selenium IDE is going to find the elements using 
Locators 
 The fire bug and fire path add-on’s must be installed in 
firefox which will be helpful for this session. (F12) 
 The different kinds of locators are 
 Id 
 Name 
 CSS or Class name 
 Link 
 Xpath
ID 
 A good developer will create the unique ID for each 
elements in the page 
 Id is mostly used and also easy to use to locate the element 
 Example for user name and password’s id in gmail account 
 <input id="Email" class="" type="email" spellcheck="false" 
value="" placeholder="Email" name="Email"> 
 <label class="hidden-label" 
for="Passwd">Password</label> 
 <input id="Passwd" class="" type="password" placeholder= 
"Password" name="Passwd"> 
 Using locator in the fire bug you could get the above details
Name 
 Name 
 <input id="signIn" class="rc-button rc-button-submit" 
type="submit" value="Sign 
in" name="signIn">
CSS 
 The syntax is CSS= cssSelector 
 Example: 
 Open IDE 
 Open the site 
(http://book.theautomatedtester.co.uk/chapter2) 
 Click on firefinder
Cont.. 
 <div id="divontheleft" class="leftdiv"> 
 <input id="but1" type="button" value="Button with 
ID"></input> 
 (two buttons Button with ID and Sibling Button are 
inside the div. Id is divontheleft and class is leftdiv) 
 Now in the firefinder enter div.leftdiv input 
 In selenium IDE, Target= (css=div.leftdiv input) 
 Click on find which will highlight the respective 
button
Link 
 The easiest way to find the link 
 In the target: link=(link) 
 Example 
 http://book.theautomatedtester.co.uk/chapter1 
 Here open http://book.theautomatedtester.co.uk 
 Then in target to open the chapter 1 
 Type: link=Chapter 1 
Note: the same format should be given. We should not 
give lower or upper as our wish..
Xpath 
 There are two types of X path – 
1. Complete or Absolute 
2. partial 
 Most partial is preferred since tomorrow if there are any changes 
it will be difficult to go with absolute. You will know it why ? 
 Let me differentiate it for the element SIGN IN 
 example for absolute path 
html/body/div[1]/div[2]/div[2]/form/input[16] 
 Example for partial path 
.//*[@id='signIn'] 
Note: If suppose any changes happens in any division it could not 
find the exact path hence partial is mostly preferred.
THE END

More Related Content

PPT
Selenium ppt
PPTX
Introduction to selenium
PPTX
Introduction to Automation Testing
PPTX
Selenium in Health and Nutrition
PPTX
Api testing
PPTX
مهارات البيع Selling - skills
PPTX
Test Automation and Selenium
PPTX
POSTMAN.pptx
Selenium ppt
Introduction to selenium
Introduction to Automation Testing
Selenium in Health and Nutrition
Api testing
مهارات البيع Selling - skills
Test Automation and Selenium
POSTMAN.pptx

What's hot (20)

PDF
Automation Testing using Selenium
PPTX
Selenium WebDriver training
PPTX
Selenium
PPT
QSpiders - Automation using Selenium
PPTX
Selenium- A Software Testing Tool
PPT
Selenium Concepts
PPTX
Introduction to Selenium Web Driver
PPT
Selenium Automation Framework
PPTX
An overview of selenium webdriver
PPT
Selenium
PPSX
Selenium WebDriver
PPTX
Automation - web testing with selenium
PDF
Selenium - Introduction
PPTX
Selenium test automation
PPTX
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
PPTX
Selenium introduction
PPT
Test automation using selenium
ODP
Selenium ppt
PDF
Automation Testing using Selenium Webdriver
PPTX
Automation Testing by Selenium Web Driver
Automation Testing using Selenium
Selenium WebDriver training
Selenium
QSpiders - Automation using Selenium
Selenium- A Software Testing Tool
Selenium Concepts
Introduction to Selenium Web Driver
Selenium Automation Framework
An overview of selenium webdriver
Selenium
Selenium WebDriver
Automation - web testing with selenium
Selenium - Introduction
Selenium test automation
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium introduction
Test automation using selenium
Selenium ppt
Automation Testing using Selenium Webdriver
Automation Testing by Selenium Web Driver
Ad

Similar to Selenium ppt (20)

DOCX
Selenium introduction and some feautures
PPTX
Selenium IDE
PPTX
Selenium IDE and Extensions
PDF
Selenium with testng and eclipse ide
PPT
Selenium Primer
PPTX
Selenium
PPT
Steps to write Selenium
PPTX
Automated Web Testing With Selenium
DOC
PPTX
Selenium Testing
PPTX
Selenium ide made easy
DOCX
What is selenium
PDF
Selenium by using JAVA
ODP
Selenium testing IDE 101
PPT
Selenium Basics by Quontra Solutions
DOCX
What is selenium
PPT
Selenium training
PDF
Selenium Tutorial
ODP
Introduction to Selenium
Selenium introduction and some feautures
Selenium IDE
Selenium IDE and Extensions
Selenium with testng and eclipse ide
Selenium Primer
Selenium
Steps to write Selenium
Automated Web Testing With Selenium
Selenium Testing
Selenium ide made easy
What is selenium
Selenium by using JAVA
Selenium testing IDE 101
Selenium Basics by Quontra Solutions
What is selenium
Selenium training
Selenium Tutorial
Introduction to Selenium
Ad

Recently uploaded (20)

DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPT
Mechanical Engineering MATERIALS Selection
PPT
Project quality management in manufacturing
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
Geodesy 1.pptx...............................................
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
Construction Project Organization Group 2.pptx
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
Well-logging-methods_new................
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Mechanical Engineering MATERIALS Selection
Project quality management in manufacturing
CYBER-CRIMES AND SECURITY A guide to understanding
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Geodesy 1.pptx...............................................
CH1 Production IntroductoryConcepts.pptx
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Foundation to blockchain - A guide to Blockchain Tech
Arduino robotics embedded978-1-4302-3184-4.pdf
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Construction Project Organization Group 2.pptx
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Well-logging-methods_new................
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Lesson 3_Tessellation.pptx finite Mathematics
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...

Selenium ppt

  • 2. INTRODUCTION  Selenium is a suite of tools used for browser automation  A well organized tool to develop test cases or test suites  Jason Huggins introduced selenium in 2004  It is developed using java scripts  It composed of 4 main components IDE, Remote Control, Web Driver and Grid  A tool to test the web based applications
  • 3. What it can do?  Selenium can test in three regards 1. Functional 2. Regression and 3. Load Testing
  • 4. THE TECHNICAL CHALLENGES IN SELENIUM  Selenium Supports only web based applications  It doesn’t support any non web based (Like Win 32, Java Applet, Java Swing, .Net Client Server etc) applications  When you compare selenium with QTP, Silk Test, Test Partner and RFT, there are many challenges in terms of maintainability of the test cases  Since Selenium is a freeware tool, there is no direct support if one is in trouble with the support of applications  There is no object repository concept in Selenium, so maintainability of the objects is very high  There are many challenges if one have to interact with Win 32 windows even when you are working with Web based applications  Bitmap comparison is not supported by Selenium  Any reporting related capabilities, you need to depend on third party tools  You need to learn any one of the native language like (.Net, Java, Perl, Python, PHP, Ruby) to work efficiently with the scripting side of selenium.
  • 5. FLEXIBILITY IN SELENIUM  Selenium testing suite is highly flexible.  There are multiple ways to add functionality to Selenium framework to customize test automation.  As compared to other test automation tools, it is Selenium’s strongest characteristic.  Selenium Remote Control support for multiple programming and scripting languages allows the test automation engineer to build any logic they need into their automated testing and to use a preferred programming or scripting language of one’s choice.  Also, the Selenium testing suite is an open source project where code can be modified and enhancements can be submitted for contribution
  • 6. SELENIUM - IDE  Also known as SIDE  Helps the developer and tester in a easier way to drive the browser in a work flow  It is developed with java script  It is an Add-on in Mozilla Firefox browser, hence ide can work only for FF browser  It can export the recorded test cases to webdriver and which can runs in many languages like Perl, Php, Java, Ruby, C#, Phyton etc..  Functional testing tool
  • 7. FEATURES - IDE  Record or play back features  Debugging step by step and breakpoints  Page abstraction functionality  User extension that expands the functionality of SIDE
  • 8. ADVANTAGE - IDE  Open source tool  Easy to install  Well organized in developing test cases  Exports test cases to many languages and which can be used in RC or Web Driver  Allows simple DOM- LEVEL testing at the same time it is used for traditional water fall model to modern Agile methodology  Records – Click, typing and other actions to make test cases  Auto complete for all common Selenium commands  Debug and set breakpoints
  • 9. DISADVANTAGE - IDE  Dreary error diagnostics  Tests only web applications  IDE works with Mozilla Firefox browser only
  • 10. SELENESE  A HTML language to drive the elements in the browser  There are three types 1. Action 2. Assertion 3. Accessors Action - is used to perform an action or interaction with the elements. Eg: open, click, type etc. Assertion – to verify or assert the expected value based on optional or mandatory Accessors – To store a value in a variable
  • 11. Assertion  Assert – If the expected value is matched if continues the next test steps. If not it aborts the test. Assert is used for the mandatory check. Note: While in a test suite it will abort the current test case and continue the next test case.  Verify – If the expected value is matched if continues the next test steps. If not the test execution will continue with the remaining steps. Verify is used for the optional check.
  • 12. Accessors  To store a value in a variable a. To get a value from an element and compare it with the dynamic variable b. To take logical decisions to execute the test steps c. To execute the loops based on the value it returns
  • 13. Basic Working of SIDE SIDE tool components Record and play back feature Assertions Multiple windows and Ajax Debugging
  • 14. Where to get the SIDE  Visit http://docs.seleniumhq.org/  Download tab  Selenium IDE version 2.5.0  You should have installed Mozilla FireFox browser  Since it’s a add-on for firefox  Once installed go to Tool Selenium IDE (or)  In the toolbar you can find Selenium IDE icon
  • 16. 1. SIDE components  Base URL: All open command will be relative to the base URL (full path). This is the URL that the test will start at.  Speed Slider: This slider is used to fast or slow mode during the play back.  (Triangle with 3 lines): Run all the tests in the id  (Triangle with 1 line): Run only single test  (||): Pause a test that is currently running  (bended down arrow): Step through the test once it has paused  Red button- This is the Record button. By default when we open the selenium IDE it will be enabled
  • 17. Cont..  Command - It is a select box has a list of all the commands that are needed to create the test. It is an auto complete functionality or use the drop down.  Target - the location of the element  Value - where you place the value that needs to be change.  Table view – Will keep track all the commands, targets and values.  Source View – You will be able to see the HTML that will store the test  Log – will show what is happening during the test run.  Reference – Documentation on the command highlighted
  • 18. 2. Record and Play back  Open Mozilla Firefox browser and Selenium IDE  By default the record mode is on  Write the URL in the Base Url  Now what ever you do in the browser those will be recorded in the SIDE  Once done stop recording and playback it  It will play you back the same action what u have done during recording.
  • 19. 3. Assertion  Assertion is a check point or verification point to verify  The two types are ASSERT and VERIFY  While recording when you right on any element you could find it in the show all available command assert and verify.  While playback it is going to verify the select action  The verified command will be glowing dark green in color.
  • 20. Pattern Matching  The pattern matching is plays a vital role in when we use verify and assert  The three major types of pattern matching are 1. GLOBBING 2. EXACT 3. REGULAR EXPRESSION  Globbing is handled with ? and * - glob:  Exact is used to match the exact word – exact:  Regular expression is used with the keyword regexp:
  • 21. Examples…  While you verify or assert in the value specify the pattern match Eg: word id cool which is a dynamically changing element like pool, mool and fool Value - glob: ?ool Which accepts any alphabet in the ?’s space  Exact is the exact word match Eg: Value – exact: cool Which accepts only cool.
  • 22. Regular expression  Consider this example 2011-05-02451 In value - regexp:[0-9]{4}-[0-9]{2}-[0-9]{5,10} So, 2011 all numeric and have 4 char so [0-9]{4} If a text is there: hi this is Selenium In Value : [a-z]{2} for hi [A-Z][a-z]{7} Selenium Or [A-Z].* Selenium * Will accept the remaining alphabets.
  • 23. 4. Multiple window and AJAX 1. As we test a page in the same way we can test all the elements on a another page  When we click the link for multiple window it may take time to load the page in the different window at that time we need to tell selenium to wait using the command “click and wait” 2. Ajax is going to load the action at the same page  Selenium do not know when does it load? At this time we need to use “wait for the element”
  • 24. Multiple windows  Open the IDE  Launch http://theautomatedtester.co.uk/  Click on Chapter 1  Click on the element “Click this to launch another window”  A small window will appear where you can even verify the text.
  • 25. Ajax  Open the IDE  Launch http://theautomatedtester.co.uk/  Click on Chapter 1  Click on the element “Click this link to load a page with AJAX”  On the same page ajax action will be loaded and we can verify the text
  • 26. 5. Debugging  It is not necessary to test the whole test cases  We can debug the single or particular command whether it is working as expected  Three types of debugging 1. Double click on the command 2. Right click on the command and select execute this command or Click on the command press “X” 3. Toggle breakpoint press ‘B’ on the command Note: while debugging make sure the browser is opened with the URL you are testing
  • 27. Accessors  How to store value in a variable? 1. Open the IDE and launch the site : http://book.theautomatedtester.co.uk/Chapter1 2. Right click on any text that you need to store in the text box available in the page 3. Select store Text 4. A dialog box will appear and ask you to enter the name of the variable 5. Enter a variable name eg: abc 6. Now stop recording 7. Click on the next blank step where the steps are recording 8. Command: Type 9. Target: storeinput //{which the id of the textbox} 10. Value: ${abc} 11. Now run the test 12. You can view the selected text in the text box.
  • 28. How it works?  We are recording and playing it back fine but how does it works or how does it verify the particular element in the page?  The selenium IDE is going to find the elements using Locators  The fire bug and fire path add-on’s must be installed in firefox which will be helpful for this session. (F12)  The different kinds of locators are  Id  Name  CSS or Class name  Link  Xpath
  • 29. ID  A good developer will create the unique ID for each elements in the page  Id is mostly used and also easy to use to locate the element  Example for user name and password’s id in gmail account  <input id="Email" class="" type="email" spellcheck="false" value="" placeholder="Email" name="Email">  <label class="hidden-label" for="Passwd">Password</label>  <input id="Passwd" class="" type="password" placeholder= "Password" name="Passwd">  Using locator in the fire bug you could get the above details
  • 30. Name  Name  <input id="signIn" class="rc-button rc-button-submit" type="submit" value="Sign in" name="signIn">
  • 31. CSS  The syntax is CSS= cssSelector  Example:  Open IDE  Open the site (http://book.theautomatedtester.co.uk/chapter2)  Click on firefinder
  • 32. Cont..  <div id="divontheleft" class="leftdiv">  <input id="but1" type="button" value="Button with ID"></input>  (two buttons Button with ID and Sibling Button are inside the div. Id is divontheleft and class is leftdiv)  Now in the firefinder enter div.leftdiv input  In selenium IDE, Target= (css=div.leftdiv input)  Click on find which will highlight the respective button
  • 33. Link  The easiest way to find the link  In the target: link=(link)  Example  http://book.theautomatedtester.co.uk/chapter1  Here open http://book.theautomatedtester.co.uk  Then in target to open the chapter 1  Type: link=Chapter 1 Note: the same format should be given. We should not give lower or upper as our wish..
  • 34. Xpath  There are two types of X path – 1. Complete or Absolute 2. partial  Most partial is preferred since tomorrow if there are any changes it will be difficult to go with absolute. You will know it why ?  Let me differentiate it for the element SIGN IN  example for absolute path html/body/div[1]/div[2]/div[2]/form/input[16]  Example for partial path .//*[@id='signIn'] Note: If suppose any changes happens in any division it could not find the exact path hence partial is mostly preferred.