How to use the writeFileSync function from selenium-webdriver
Find comprehensive JavaScript selenium-webdriver.writeFileSync code examples handpicked from public code repositorys.
GitHub: bgoonz/my-gists
200 201 202 203 204 205 206 207 208
``` Example: ``` const fs = require('fs');const webdriver = require('selenium-webdriver');const chromedriver = require('chromedriver');const chromeCapabilities = webdriver.Capabilities.chrome();chromeCapabilities.set('chromeOptions', {args: ['--headless']});const driver = new webdriver.Builder() .forBrowser('chrome') .withCapabilities(chromeCapabilities) .build();// Navigate to google.com, enter a search.driver.get('https://www.google.com/');driver.findElement({name: 'q'}).sendKeys('webdriver');driver.findElement({name: 'btnG'}).click();driver.wait(webdriver.until.titleIs('webdriver - Google Search'), 1000);// Take screenshot of results page. Save to disk.driver.takeScreenshot().then(base64png => { fs.writeFileSync('screenshot.png', new Buffer(base64png, 'base64'));});driver.quit(); ``` #### Using WebDriverIO
5
7
0
selenium-webdriver.Builder is the most popular function in selenium-webdriver (1701 examples)