Module: Thoran::Selenium::WebDriver::Remote::W3C::Bridge::ConvertLocators

Defined in:
lib/Thoran/Selenium/WebDriver/Remote/W3C/Bridge/ConvertLocators/convert_locators.rb

Instance Method Summary collapse

Instance Method Details

#convert_locators(how, what) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/Thoran/Selenium/WebDriver/Remote/W3C/Bridge/ConvertLocators/convert_locators.rb', line 18

def convert_locators(how, what)
  case how.to_s
  when 'class name'
    how = 'css selector'
    what = ".#{escape_css(what)}"
  when 'id'
    how = 'css selector'
    what = "##{escape_css(what)}"
  when 'name'
    how = 'css selector'
    what = "*[name='#{escape_css(what)}']"
  when 'tag name'
    how = 'css selector'
  end
  [how, what]
end