-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlocatingWithCssSelector.txt
48 lines (27 loc) · 1.09 KB
/
locatingWithCssSelector.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
38. Locating Elements Using CSS Selector (Cheat sheet attached)
https://duckduckgo.com/
search element by name
input[name=q]
search element by class name
input.js-search-input
http://semhora.com.br/
search element by id
#dropDownNavMenu
search element by class name
.eventBox
search element by direct child element
#events_relacionados > #eventList
=====================================================
=====================================================
https://www.udemy.com/selenium-webdriver-with-python/learn/v4/t/lecture/1402506
39. Dealing with Dynamic Elements
<input type="checkbox" value="true" id="Form_74c898"/>
How to locate element?
1) Locate element by the part of its identifier that does not change.
//input[contains(@id, 'Form_')]
2) Use Xpath to locate the dyamic element relatively to a static element.
=====================================================
=====================================================
Compare Xpath and CSS Selector
https://www.udemy.com/selenium-webdriver-with-python/learn/v4/t/lecture/1279208
40. Comparing Locator Strategies