Driver
Code Snippet
require 'selenium-webdriver'
# driver engine
# :edge -> for edge
# :chrome -> for chrome
# :firefox -> for firefox
@driver = Selenium::WebDriver.for :edge
@driver.get("https://www.google.com/")
@driver.manage.timeouts.implicit_wait = 30
keyword = "Stackoverflow"
input = @driver.find_element(:xpath, "//input[@name='q']")
input.send_keys(keyword)
input.submit()
sleep(10)
Komentar