class Selenium::Session

Defined in:

lib/selenium/src/webdriver/session.cr
lib/selenium/src/webdriver/session/cookies.cr
selenium/patch/selenium/session.cr
selenium/patch/selenium/session/download.cr
selenium/patch/selenium/session/logger.cr
selenium/patch/selenium/session/retry.cr
selenium/patch/selenium/session/setting.cr
selenium/patch/selenium/session/wait.cr

Instance Method Summary

Instance Method Detail

def close #

[View source]
def css(*args) : Array(WebElement) #

[View source]
def download(ext : String | Nil = nil, timeout : Time::Span | Nil = nil, interval : Time::Span | Nil = nil, &block : -> T) : Bytes forall T #

[View source]
def downloads(ext = nil) #

[View source]
def downloads_dir : String #

[View source]
def downloads_dir=(downloads_dir : String) #

[View source]
def fill(by : Symbol, selector : String, value, parent : WebElement | Nil = nil) : WebElement #

[View source]
def fill(target : String, value, parent : WebElement | Nil = nil) : WebElement #

[View source]
def fill!(target : String, value, parent : WebElement | Nil = nil) : WebElement #

[View source]
def find(id : String | Nil = nil, css : String | Nil = nil, parent : WebElement | Nil = nil) : WebElement #

#find is a wrapper of find_element with accepting prefixed css: or id:

  • find(id: "foo") # invokes find_element(:id, "foo")
  • find(css: "foo") # invokes find_element(:css, "foo")
  • find("foo") # same as find(id: "foo")
  • find("id:foo") # same as find(id: "foo")
  • find("css:foo") # same as find(css: "foo")

[View source]
def find!(*args, **opts) : WebElement #

#find! acts same as #find except it waits until it will be found. This is useful after a page transition or after the element has changed dynamically.


[View source]
def find?(*args, **opts) : WebElement | Nil #

#find? acts same as #find except it returns nil rather than raising error when the element is not found.


[View source]
def id(*args) : WebElement #

#####################################################################

Syntax Sugar


[View source]
def logger : Logger #

[View source]
def logger=(logger : Logger) #

[View source]
def open(url : String, strict = false) #

[View source]
def select(*args, **opts) : WebElement #

#select is a shortcut for find(...).select


[View source]
def select!(*args, **opts) : WebElement #

#select! acts same as #select except this ensures that the element is actually selected, otherwise raise an error.


[View source]
def select?(*args, **opts) : WebElement | Nil #

#select? acts same as #select except this ensures that the element is actually selected, otherwise returns nil.


[View source]
def setting : Setting #

[View source]
def setting=(setting : Setting) #

[View source]
def wait(hint : String | Nil = "wait", interval : Time::Span | Nil = nil, timeout : Time::Span | Nil = nil, &condition : -> T) forall T #

[View source]