= Web Driver Notes 2018 = ''Presented by Brian Burg'' * WebDriver is a test runner for web content in Safari * [demo of WebDriver running test suites] * WebDriver is pretty powerful/flexible * Create/find/test elements * Run JavaScript * Create/resize/close windows * Architecture breakdown * Test/TestRunner * Python * Uses a library (e.g. selenium) * DOM interaction/api * Turns each call into REST API calls * Driver (e.g. SafariDriver, GTKDriver) * web server with REST API * receives calls from test/testrunner * must be able to tell browser what to do * API is standardized * Test breakdown * Driver represents a session with Safari * able to interact with browser (e.g. bind elements by ID, execute scripts) * able to pass objects from the test into the test to be accessible via javascript * Able to be run across multiple machines due to REST api system * Safari 12 / WebKit TOT implements W3C WebDriver standard * Safari is fastest WebDriver implementation * Many tests still don't pass (OpenSource/WebDriverTests/TestExpectations.json) * WebDriver for WKWebView * Currently WebDriver only works in the browser, not within an app * Idea is to allow each app to opt-in WebDriver for all views within that app * WebDriver for iOS * Currently WebDriver only works for mac Safari, not iOS Safari * Requesting a new session would allow an iOS/Simulator Safari driver * depends on the system (e.g. connected devices, simulators) * Some API wouldn't work on mobile, as they were developed for desktop * resizing the window * click vs touch * RPC protocol is based on WebInspector protocol