DevTools and Headless Chrome - The Automation Power-Couple

A presentation at GDG DevFest Ukraine in October 2017 in Lviv, Lviv Oblast, Ukraine, 79000 by Yonatan Mevorach

Slide 1

Slide 1

DEVTOOLS & HEADLESS CHROME: THE AUTOMATION POWER-COUPLE

Slide 2

Slide 2

Yonatan Mevorach {{company}} @cowchimp

Slide 3

Slide 3

Slide 4

Slide 4

”I can’t automate this” -- no one ever (after watching this talk)

Slide 5

Slide 5

Web Automation youtu.be/fsF7enQY8uI

Slide 6

Slide 6

Headless Browsers cbnd flic.kr/p/qnSPdN

Slide 7

Slide 7

Chrome

Slide 8

Slide 8

headless Chrome

Slide 9

Slide 9

Slide 10

Slide 10

Slide 11

Slide 11

Slide 12

Slide 12

Slide 13

Slide 13

Slide 14

Slide 14

Slide 15

Slide 15

Slide 16

Slide 16

Slide 17

Slide 17

Slide 18

Slide 18

Slide 19

Slide 19

Slide 20

Slide 20

Slide 21

Slide 21

Slide 22

Slide 22

Slide 23

Slide 23

Slide 24

Slide 24

Slide 25

Slide 25

Slide 26

Slide 26

Slide 27

Slide 27

Slide 28

Slide 28

Slide 29

Slide 29

headless Chrome

Slide 30

Slide 30

headless Firefox

Slide 31

Slide 31

Chrome DevTools

Slide 32

Slide 32

Slide 33

Slide 33

Slide 34

Slide 34

Slide 35

Slide 35

protocol Chrome DevTools

Slide 36

Slide 36

DevTools Embedding Frontendapp WebSockets ChromeAPI Headless Adapted from content by © Sami Kyöstilä, Google goo.gl/yQi9kZ

Slide 37

Slide 37

{ id: 1, method: "Runtime.evaluate", params: { expression: "1 + 1" } } DevTools Embedding Frontendapp ChromeAPI Headless Adapted from content by © Sami Kyöstilä, Google goo.gl/yQi9kZ

Slide 38

Slide 38

{ id: 1, method: "Runtime.evaluate", params: { expression: "1 + 1" } } DevTools Embedding Frontendapp ChromeAPI Headless { id: 1, result: { result: { type: "number", value: 2, description: "2" }, wasThrown: false } } Adapted from content by © Sami Kyöstilä, Google goo.gl/yQi9kZ

Slide 39

Slide 39

Slide 40

Slide 40

Accessibility Cache storage Animation Console CSS Device orientation DOM Emulation Heap profiler Inspector Page Application cache IO Profiler Service worker Database DOM debugger Debugger DOM storage IndexedDB Layer tree Rendering Input Memory Runtime Tracing Network Security Worker Adapted from content by © Sami Kyöstilä, Google goo.gl/yQi9kZ

Slide 41

Slide 41

DevTools Embedding client app DevTools Headlesstarget API Adapted from content by © Sami Kyöstilä, Google goo.gl/yQi9kZ

Slide 42

Slide 42

node --inspect index.js

Slide 43

Slide 43

Slide 44

Slide 44

Slide 45

Slide 45

Slide 46

Slide 46

headless protocol

Slide 47

Slide 47

chrome --headless --disable-gpu --remote-debugging-port=9222 https://devfest.gdg.org.ua

Slide 48

Slide 48

chrome --headless --disable-gpu --remote-debugging-port=9222 https://devfest.gdg.org.ua

Slide 49

Slide 49

chrome --headless --disable-gpu --remote-debugging-port=9222 https://devfest.gdg.org.ua

Slide 50

Slide 50

chrome --headless --disable-gpu --remote-debugging-port=9222 https://devfest.gdg.org.ua

Slide 51

Slide 51

chrome --headless --disable-gpu --remote-debugging-port=9222 https://devfest.gdg.org.ua

Slide 52

Slide 52

chrome --headless --disable-gpu --remote-debugging-port=9222 https://devfest.gdg.org.ua

Slide 53

Slide 53

Slide 54

Slide 54

DevTools Protocol Selenium Puppeteer

Slide 55

Slide 55

Slide 56

Slide 56

Slide 57

Slide 57

Slide 58

Slide 58

o pixabay.com/photo-175605

Slide 59

Slide 59

o pixabay.com/photo-175605

Slide 60

Slide 60

Slide 61

Slide 61

Slide 62

Slide 62

Slide 63

Slide 63

Slide 64

Slide 64

Slide 65

Slide 65

Slide 66

Slide 66

Slide 67

Slide 67

Slide 68

Slide 68

Slide 69

Slide 69

Slide 70

Slide 70

Slide 71

Slide 71

Slide 72

Slide 72

Slide 73

Slide 73

Recap! q goo.gl/j41BaC

Slide 74

Slide 74

tinyurl.com/ headless-talk @cowchimp blog.cowchimp.com