Selenium 4 New Features by Examples in Ruby

start_cell = driver.find_element(id: "test_products_only_flag")
elem_label = driver.find_element(relative: { tag_name: "span",
right: start_cell })
expect(elem_label.text).to eq("Test automation products only")
 elem = driver.find_element(:id, "get_coupon_btn")
elem.save_screenshot("/tmp/button.png")
new_win = driver.manage.new_window(:window)
driver.switch_to.window(new_win)
driver.get("https://whenwise.com")
driver.close
driver.switch_to.window(driver.window_handles[0])
new_tab = driver.manage.new_window(:tab)
driver.switch_to.window(new_tab)
driver.get("https://testwisely.com")
driver.close
driver.switch_to.window(driver.window_handles[0])
driver.devtools.page.navigate(url: "http://google.com")
driver.devtools.console.clear_messages
driver.devtools.page.enable
driver.devtools.page.on(:load_event_fired) do |params|
puts("Page loaded in #{params["timestamp"]}")
end
cannot load such file -- selenium/devtools/v89

Award-winning software developer, test automation & CT coach, author, and speaker. Help teams succeed with Agile/DevOps by implementing real Continuous Testing.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store