CSS selectors and XPaths are a very easy way to select mandatory elements on a website. When using CSS there are there standard selectors that are often used.
- Element Selector – element selectors are used if the HTML elements need to be selected. This could be a div, form, input, ul or anything else that is allowed in the HTML standard. Such elements can be selected by their plain name
CSS Selector: form
- ID Selector – many main elements on HTML pages have an id attribute. This attribute should be unique within the whole page. When using the id it is possible to select special elements.
CSS Selector: #commentbox
- Class Selector – class selectors are very similar to id selectors. They are used if an element should be selected by one of their class names
CSS Selector: .active
The HTML document is the initial content that was created by the web server and was transferred to the browser. This content is more stable because no changes by the browser were done.