Skip to content

Instantly share code, notes, and snippets.

View Blue-Pix's full-sized avatar
💭
🤔

Blue-Pix Blue-Pix

💭
🤔
  • Amazon Web Services Japan G.K.
  • Tokyo
View GitHub Profile
@Blue-Pix
Blue-Pix / app.rb
Last active April 22, 2019 09:45
scroll to particular element using selenium
require "selenium-webdriver"
driver = Selenium::WebDriver.for :chrome
driver.find_element(:id, "foo").location_once_scrolled_into_view
# then, there is element at bottom of window.
@Blue-Pix
Blue-Pix / app.rb
Last active April 22, 2019 09:47
manipulate dummy checkbox using selenium
require "selenium-webdriver"
driver = Selenium::WebDriver.for :chrome
# element of input[type="checkbox"]
element = driver.find_element(:id, "foo")
# return true if element checked
element.selected?
# toggle checked state
element.click