Locators in Selenium

Locator in selenium IDE:
  1. identifier
  2. id
  3. name
  4. link
  5. xpath
  6. css
  7. dom

<input class="textclass" id="txt" name="edit" type="text" />

<a href="http://www.google.co.in/">Google</a> Google

Locators Expression
identifier identifier=txt
identifier=edit
id id=txt
name name=edit
linklink=Google
xpath xpath=//*[@id = 'txt']
xpath=//input[@id = 'txt']
xpath=//input[@name='edit']
xpath=//div/input[@id='txt']
css css=#txt
css=.textclass
css=*[id='txt']
css=input[id='txt']
css=input[name='edit']
css=div > input[id='txt']
dom dom=document.getElementById('txt')
dom=document.getElementsByName('edit')[0]
dom=document.getElementsByClassName('textclass')[0]
dom=document.getElementsByTagName('input')[0]

1 comment:

  1. Thank you for sharing wonderful information with us to get some idea about that content.
    Selenium Online Training India
    Selenium Online Training

    ReplyDelete