-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.txt
65 lines (52 loc) · 2.78 KB
/
README.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<!-- Esto basicamente es lo que sirve para correr desde consola y el include te cambia dependiendo de la nomenclatura que tu le des a tus clases test -->
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<includes>
<include>**/*Test.java</include>
</includes>
<systemPropertyVariables>
<application.properties>/application.properties</application.properties>
</systemPropertyVariables>
</configuration>
</plugin>
//Plugin para poder correr todos los archivos que sean del tipo ...Test.java desde consola
Selenium, que es?
Version 1-> Javascript interactions to actually talk to the browser
Version 2-> JSON Wire protocol
Version 4 -> Soon W3C support
Para saber si las interacciones sirven para determinado navegador -> webdriver-herald.herokuapp.com
ExplicitWait -> Se asegura que el browser esté en determinado estado al encontrar un elemento
XPATH - IMPORTANTE
'/' SELECCIONA DEL NODO RAIZ
'//' SELECCCIONA NODOS EN EL DOCUMENTO DEL NODO ACTUAL, QUE COINCIDAN CON LA SELECCION, NO IMPORTA DONDE ESTÉN
'.' O TAMBIEN LLAMADO PERIOD, SELECCIONA EL NODO ACTUAL
'..' DOUBLE PERIOD, SELECCIONA EL PADRE DEL NODO ACTUAL
'@' PERMITE SELECCIONAR ATRIBUTOS
'*' COINCIDE CON CUALQUIER ELEMENTO NODO
'contains(text(),<<string>>)' EJEMPLO QUE PERMITE ENCONTRAR UN TEXTO BY UN XPATH
'parent' PADRE DIRECTO DEL ELEMENTO
'sibling' AL MISMO NIVEL, HERMANO DIRECTO
'children' UN NIVEL MÁS ABAJO, HIJO DIRECTO
COMPUND CLASSES (ATRIBUTO CLASS QUE TIENE ESPACIO) NO SE PUEDEN SELECCIONAR CON BYCLASSNAME-SOLO SE PUEDE USAR XPATH
'[@atributo='nombre'][@atributo2='nombre2']' EJEMPLO PARA SELECCIONAR MÁS DE UN ATRIBUTO
CSS VS XPATH
XPATH
- Puede recorrer el DOM de hijo a padre, para arriba y para abajo
- Puede localizar elementos por texto
- Es más legible por computadoras
CSS SELECTOR
- Solo puede recorrer el DOM de padre a hijo y de derecha a izquierda
- Es más legible por seres humanos
- Los frontend devs lo entienden mejor
- MUY BUENO PARA AUTOMATIZACIÓN MOBILE, XPATH ES BASTANTE LENTO EN MOBILE , IOS NI SIQUIERA TIENE UN XML MAP, DEBE SER CREADO POR APPIUM
locators cheat sheet --> https://www.automatetheplanet.com/selenium-webdriver-locators-cheat-sheet/
Implicit wait
Le dice al webdriver que espere por un intervalo determinado de tiempo antes de tirar una excepcion de elemento no encontrado
Explicit wait
Le dice al webdriver que espere hasta que se cumpla cierta condición como puede ser, que un elemento esté visible
Which TAB WE ARE ACTUALLY ON
.getWindowHandle() <-- Devuelve un String que identifica en que tab nos encontramos
.getWindowHandles() <-- Devuelve un String que identifica todas las tabs actualmente abiertas
DIFFERENCE BETWEEN NAVIGATE TO AND GET
navigate to and get are the same, the interface navigate facilita ciertos metodos como back y forward para el historial.