Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Automate simple & repeated browser tasks

Automate simple & repeated browser tasks

はじめての英語プレゼン #4
https://english-lt.connpass.com/event/67958/

E8aaf6f975dda96c47412cf311089243?s=128

Tadashi Nemoto

October 25, 2017
Tweet

Transcript

  1. 2017/10/25 Tadashi Nemoto Automate simple & repeated browser tasks

  2. Introduction • Tadashi Nemoto • github: tadashi0713 • QA-SET Team

    @mercari • Automation Engineer
  3. Many repeated browser tasks • Give member account • Get

    image of graph & send to Slack • Get specific data in page • Download file from page • Fill form same content • etc
  4. Some services need browser operation for automating these tasks Selenium

  5. Tools to automate browser tasks

  6. Use headless chrome • Either need when running selenium in

    non display environment • Virtual display • Xvfb, Xdummy • Headless browser • PhantomJS, Chrome 59
  7. Using headless chrome is easy • Installing chromedriver via gem

    https://github.com/flavorjones/chromedriver-helper
  8. Easy to write code for browser automation • driver.get ‘https://www.google.co.jp’

    • driver.find_element(:id, ‘hoge’).click • driver.find_element(:id, ‘hoge’).send_keys ‘hoge’ • driver.find_element(:id, ‘hoge’).text • driver.save_screenshot(‘path/to/screenshot.png’)
  9. How to trigger build • cron • https://circleci.com/docs/2.0/workflows/ #scheduling-a-workflow •

    Create slack bot or slash command
  10. Thank you!