As we have started writing simple web application login like scripts, its time to move one step ahead. Till now we were finding web elements using general locators like id, name, classname etc. but sometimes it is difficult to find elements using these locators. What if elements don't have these locators, What if some elements are dynamically changing, to answer all these questions, we have Xpath . Xpath is used to find complex and dynamically changing web elements of the web page. It is defined as XML path, it is basically a syntax for finding web element using its XML path expression. It takes advantage of HTML DOM structure while finding web elements. Syntax: Xpath= //tagname[@attribute='value'] // : current node tagname : name of the tags like input, a, img, label etc. attribute : name of the attributes like id, name, classname etc. value : value of that particular attribute There are mainly two types of Xpath. Absolute Xpath: Xpath finds...
Comments
Post a Comment