Saturday 5 May 2012

What is XPath?

XPath is normally called as XML Path.

We use XPath to navigate through elements, and attributes in the XML document.
As per W3C's, the XPath is a major element in XSLT standard - and XQuery and XPointer are both built on XPath expressions.

XPath is the language for finding information in an XML document.

What XPath is?
  • It is a syntax for defining parts of an XML document
  • It uses path expressions to navigate in XML documents
  • It contains the library of standard functions
  • It is vital element in XSLT
  • It is W3C recommendation



Normally in every web-based applications the XPaths or locators are unique addresses for each and every web object. It can be used with selenium to
perform operations on each object present in the webpage. In the web page each web-object has a primary unique XPath.

XPaths are derived from the html paths of the objects. One can install firebug, and on the top of firebug, one can install firpath. Both are installed as addons on Firefox.
 
When one extracts the xpath of the object, one can use that object using Selenium IDE, Selenium RC, or Selenium Web-driver. Xpaths are constants. They do rarely change. If there is a text-box, and the label of the text-box changes but the position does not change then xpath remains the same. Sometimes xpaths alo vary everytime you refresh the page. To handle variable XPath you need to use java-script functions. Varying xpaths always have a pattern.

9 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Thank you, You have spent good time I guess to write this kind of good articles, there is lnk for xpath, please do read it.relative xpath in Selenium webdriver

    ReplyDelete
  3. Perhitungan kartu pada permainan Bandar Q sama dengan perhitungan di cara main adu q. Yaitu angka 9 sebagai angka tertinggi sehingga bila hitungan melewati sembilan maka hitungan akan mulai lagi dari 0.
    asikqq
    dewaqq
    sumoqq
    interqq
    pionpoker
    bandar ceme terbaik
    hobiqq
    paito warna
    bocoran sgp
    data hk

    ReplyDelete