Web Locator¶
web element : Everything in web page
A Webpage consists of three element
- HTML (Hyper text markup Language)
- CSS (cascading styling sheet)
- JS (java Script)
DOM Document Object Model
If you press webpage resource with various method (for example cmd+shift+C) you will show web element. select
should be blue for choose.
Types of Locator¶
- id
id
is most important locator. If webpage has a id
use it. #
sign represent ID
- Name
- Class Name
Class name represent two types:
1. `classa-b` means there is one class and its name is classa-b
2. `classa b` means there are two class one of them is classa the other is b
Class 4. CSS Selector
CSS Selector combine filter like below div#content.content-wrapper
. Lets piece of this filter.
.content-wrapper
class name, but there is two classname
div
it include div which has id content
(# means id)
- XPath