There are 8 ways to locate the element in the web page
- Class Name
- Css Selector
- Id
- Link Text
- Name
- Partial Link Text
- Tag Name
- Xpath
Xpath
Xpath is categorized in two types
1 . Absolute Xpath
2 . Relative Xpath
Let us write the xpath based on the given example
Writing absolute xpath for the above
/select/option[1]
Writing relative xpath for the above
//select[@option='volvo']
Note
Difference between Absolute xpath and Relative xpath : Absolute xpath will start with root path(/) where as Relative xpath will start from the current path.
Will add more content soon.....


No comments:
Post a Comment