DevTools and Headless Chrome - The Automation Power-Couple

A presentation at Reversim Summit in October 2017 in Rishon LeTsiyon, Israel 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

shlomi-noach has 208 followers!

Slide 22

Slide 22

Slide 23

Slide 23

Slide 24

Slide 24

headless Chrome

Slide 25

Slide 25

headless Firefox

Slide 26

Slide 26

Chrome DevTools

Slide 27

Slide 27

Slide 28

Slide 28

Slide 29

Slide 29

Slide 30

Slide 30

protocol Chrome DevTools

Slide 31

Slide 31

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

Slide 32

Slide 32

{ 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 33

Slide 33

{ 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 34

Slide 34

Slide 35

Slide 35

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 36

Slide 36

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

Slide 37

Slide 37

node --inspect index.js

Slide 38

Slide 38

Slide 39

Slide 39

Slide 40

Slide 40

Slide 41

Slide 41

headless protocol

Slide 42

Slide 42

chrome --headless --disable-gpu --remote-debugging-port=9222 http://summit2017.reversim.com

Slide 43

Slide 43

chrome --headless --disable-gpu --remote-debugging-port=9222 http://summit2017.reversim.com

Slide 44

Slide 44

chrome --headless --disable-gpu --remote-debugging-port=9222 http://summit2017.reversim.com

Slide 45

Slide 45

chrome --headless --disable-gpu --remote-debugging-port=9222 http://summit2017.reversim.com

Slide 46

Slide 46

chrome --headless --disable-gpu --remote-debugging-port=9222 http://summit2017.reversim.com

Slide 47

Slide 47

chrome --headless --disable-gpu --remote-debugging-port=9222 http://summit2017.reversim.com

Slide 48

Slide 48

Slide 49

Slide 49

DevTools Protocol Selenium Puppeteer

Slide 50

Slide 50

Slide 51

Slide 51

Slide 52

Slide 52

Slide 53

Slide 53

o pixabay.com/photo-175605

Slide 54

Slide 54

o pixabay.com/photo-175605

Slide 55

Slide 55

Slide 56

Slide 56

Slide 57

Slide 57

Slide 58

Slide 58

Slide 59

Slide 59

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

Recap! q goo.gl/j41BaC

Slide 69

Slide 69

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