Skip to content

Instantly share code, notes, and snippets.

@ivaravko
Created March 8, 2012 20:23
Show Gist options
  • Save ivaravko/2003189 to your computer and use it in GitHub Desktop.
Save ivaravko/2003189 to your computer and use it in GitHub Desktop.
Don`t find button element using :css
require 'selenium-webdriver'
require 'page-object'
browser = Selenium::WebDriver.for :ff
=begin
browser.get "data:text/html;content-type=utf-8,#{URI.escape DATA.read}"
element = browser.find_element(:css => "input[type='submit']")
element.click
ensure
browser.quit
=end
class TestCss
include PageObject
page_url "data:text/html;content-type=utf-8,#{URI.escape DATA.read}"
button(:save, :css => "input[type='submit']")
end
begin
test_css = TestCss.new(browser, true)
test_css.save
ensure
browser.close
end
__END__
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Test CSS button</title>
</head>
<body>
<input type="submit" id="save" value="save">
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment