Sha256: 2fdd1c603e53decc1eba6672d471559eadb22e5ec2a7b2462c780de3f7150000
Contents?: true
Size: 969 Bytes
Versions: 41
Compression:
Stored size: 969 Bytes
Contents
# frozen_string_literal: true require 'selenium-webdriver' require_relative 'driver_helper' module Raider module SeleniumHelper def click_when_present # This is an example of an implicit wait in selenium wait = Selenium::WebDriver::Wait.new(timeout: 15) wait.until { displayed? } click end def select_by(key, value) # Creates new Select object to use the select by method dropdown = Selenium::WebDriver::Support::Select.new self dropdown.select_by(key, value) end def hover # Using actions to move the mouse over an element DriverHelper.driver.action.move_to(self).perform end # How to perform right click through the context click method def right_click DriverHelper.driver.action.context_click(self).perform end end # Here we are opening the selenium class and adding our custom method class Selenium::WebDriver::Element include SeleniumHelper end end
Version data entries
41 entries across 41 versions & 1 rubygems