{"id":351,"date":"2012-03-09T08:03:39","date_gmt":"2012-03-09T14:03:39","guid":{"rendered":"http:\/\/scottcsims.com\/wordpress\/?p=351"},"modified":"2016-07-12T11:14:02","modified_gmt":"2016-07-12T16:14:02","slug":"what-does-the-seleniumfury-generator-find-on-a-page-for-you","status":"publish","type":"post","link":"http:\/\/scottcsims.com\/wordpress\/?p=351","title":{"rendered":"What does the SeleniumFury generator find on a page for you?"},"content":{"rendered":"<p>What should you expect SeleniumFury to find on a page for you? \u00a0 Take a look behind the curtains at the <a title=\"PageParser\" href=\"https:\/\/github.com\/scottcsims\/SeleniumFury\/blob\/master\/lib\/selenium_fury\/common\/page_parser.rb\" target=\"_blank\">PageParser<\/a> class on git hub.<br \/>\nYou will find that I am using Nokogiri xml parser to find elements and you will see this list of html elements that I am looking for.<\/p>\n<pre class=\"brush: ruby\">          @nokogiri_selectors= [\"select\",\r\n                              \"textarea\",\r\n                              \"form\",\r\n                              \"input\",\r\n                              \"input[type='button']\",\r\n                              \"input[type='file']\",\r\n                              \"input[type='checkbox']\",\r\n                              \"input[type='password']\",\r\n                              \"input[type='radio']\",\r\n                              \"input[type='reset']\",\r\n                              \"input[type='image']\",\r\n                              \"input[type='submit']\",\r\n                              \"input[type='text']\"]<\/pre>\n<p>The only fields that are found are simple HTML fields.<\/p>\n<p>For more complex UI elements like jquery select menus, I usually will define the class and write a unit test for the actions that can be done on the component.<br \/>\nYou can use the page method on PageObject to define a subpage or page component like this.<\/p>\n<pre class=\"brush: ruby\">  \r\nclass SelectMenu &lt; PageObject     #This could be a jquery select menu     element :select_menu, {:id =&gt; \"selectSomething\"}\r\n    def select index\r\n      #code to select\r\n    end \r\nend\r\nclass SearchPage &lt; PageObject\r\n     #add the component to your main page\r\n     page :select_menu, SelectMenu\r\nend\r\n#Use your page component\r\nSearchPage.new(driver).select_menu.select(2)<\/pre>\n<p>I have more examples of this in the SeleniumFury source. See this<a title=\"Tests\" href=\"https:\/\/github.com\/scottcsims\/SeleniumFury\/blob\/master\/spec\/selenium_web_driver\/page_object_spec.rb\" target=\"_blank\"> PageObject Unit Test(spec)<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>What should you expect SeleniumFury to find on a page for you? \u00a0 Take a look behind the curtains at the PageParser class on git hub. You will find that I am using Nokogiri xml parser to find elements and you will see this list of html elements that I am looking for. @nokogiri_selectors= [&#8220;select&#8221;, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[26],"tags":[],"class_list":["post-351","post","type-post","status-publish","format-standard","hentry","category-seleniumfury"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=351"}],"version-history":[{"count":14,"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/351\/revisions"}],"predecessor-version":[{"id":369,"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/351\/revisions\/369"}],"wp:attachment":[{"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=351"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}