{"id":205,"date":"2016-08-15T09:00:16","date_gmt":"2016-08-15T14:00:16","guid":{"rendered":"http:\/\/blog.benedettitech.com\/wp\/?p=205"},"modified":"2018-05-30T14:11:05","modified_gmt":"2018-05-30T19:11:05","slug":"ui-unit-testing-with-selenium-part-1","status":"publish","type":"post","link":"http:\/\/blog.benedettitech.com\/wp\/2016\/08\/15\/ui-unit-testing-with-selenium-part-1\/","title":{"rendered":"UI Unit Testing with Selenium &#8211; Part 1"},"content":{"rendered":"<p><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.seleniumhq.org\/images\/big-logo.png?w=660\" \/><br \/>\nSo, I&#8217;m making it through the Selenium\u00a0<a href=\"https:\/\/app.pluralsight.com\/library\/courses\/selenium\/table-of-contents\" target=\"_blank\">Pluralsight course<\/a>\u00a0slowly but surely and I&#8217;m learning quite a bit so far.<\/p>\n<p>The first part covers a browser plug-in called\u00a0Selenium IDE. \u00a0Available only for Firefox, it&#8217;s essentially a session recording tool, \u00a0It records what we do in the browser then parses those into commands and then can be played back to act as tests. \u00a0To take this out for a spin, I went ahead and installed the plug-in and watched the demo on the course. \u00a0Now, we&#8217;ll need to find something suitable to test it on.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/selenium.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"210\" data-permalink=\"http:\/\/blog.benedettitech.com\/wp\/2016\/08\/15\/ui-unit-testing-with-selenium-part-1\/selenium\/\" data-orig-file=\"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/selenium.jpg?fit=1920%2C1080\" data-orig-size=\"1920,1080\" data-comments-opened=\"1\" data-image-title=\"selenium\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/selenium.jpg?fit=660%2C371\" class=\"alignnone size-large wp-image-210\" src=\"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/selenium.jpg?resize=660%2C371\" alt=\"selenium\" width=\"660\" height=\"371\" srcset=\"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/selenium.jpg?resize=1024%2C576 1024w, https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/selenium.jpg?resize=300%2C169 300w, https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/selenium.jpg?resize=768%2C432 768w, https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/selenium.jpg?w=1920 1920w, https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/selenium.jpg?w=1320 1320w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/a><\/p>\n<p>There&#8217;s a SaaS platform called <a href=\"https:\/\/developer.servicenow.com\/\">ServiceNow<\/a> that I&#8217;ve been spending a great deal of time in this year. \u00a0Automating testing against this platform from a central host is one of my goals for this experiment. \u00a0To test this out, I&#8217;ve created a <a href=\"https:\/\/dev20556.service-now.com\/navpage.do\">test instance<\/a> of ServiceNow and a test user. \u00a0Also, I&#8217;ve installed the Selenium IDE on Firefox so that I can record my session in the platform.<\/p>\n<p>My demo is basically automating a login for my test user. \u00a0First I&#8217;ll need to create a fresh test case in Selenium.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/newtest.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"209\" data-permalink=\"http:\/\/blog.benedettitech.com\/wp\/2016\/08\/15\/ui-unit-testing-with-selenium-part-1\/newtest\/\" data-orig-file=\"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/newtest.jpg?fit=1493%2C766\" data-orig-size=\"1493,766\" data-comments-opened=\"1\" data-image-title=\"newtest\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/newtest.jpg?fit=660%2C338\" class=\"alignnone size-large wp-image-209\" src=\"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/newtest.jpg?resize=660%2C338\" alt=\"newtest\" width=\"660\" height=\"338\" srcset=\"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/newtest.jpg?resize=1024%2C525 1024w, https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/newtest.jpg?resize=300%2C154 300w, https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/newtest.jpg?resize=768%2C394 768w, https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/newtest.jpg?w=1493 1493w, https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/newtest.jpg?w=1320 1320w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/a><\/p>\n<p>Then, I&#8217;ll record the steps to the login to get a complete test.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/finishedtest.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"208\" data-permalink=\"http:\/\/blog.benedettitech.com\/wp\/2016\/08\/15\/ui-unit-testing-with-selenium-part-1\/finishedtest\/\" data-orig-file=\"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/finishedtest.jpg?fit=1493%2C766\" data-orig-size=\"1493,766\" data-comments-opened=\"1\" data-image-meta=\"{&quot;orientation&quot;:&quot;1&quot;}\" data-image-title=\"finishedtest\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/finishedtest.jpg?fit=660%2C338\" class=\"alignnone size-large wp-image-208\" src=\"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/finishedtest.jpg?resize=660%2C338\" alt=\"finishedtest\" width=\"660\" height=\"338\" srcset=\"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/finishedtest.jpg?resize=1024%2C525 1024w, https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/finishedtest.jpg?resize=300%2C154 300w, https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/finishedtest.jpg?resize=768%2C394 768w, https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/finishedtest.jpg?w=1493 1493w, https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/finishedtest.jpg?w=1320 1320w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/a><\/p>\n<p>Then I&#8217;ll run the test and see if it logs me into the system, which it does.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/success.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"211\" data-permalink=\"http:\/\/blog.benedettitech.com\/wp\/2016\/08\/15\/ui-unit-testing-with-selenium-part-1\/success\/\" data-orig-file=\"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/success.jpg?fit=1920%2C1080\" data-orig-size=\"1920,1080\" data-comments-opened=\"1\" data-image-title=\"success\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/success.jpg?fit=660%2C371\" class=\"alignnone size-large wp-image-211\" src=\"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/success.jpg?resize=660%2C371\" alt=\"success\" width=\"660\" height=\"371\" srcset=\"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/success.jpg?resize=1024%2C576 1024w, https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/success.jpg?resize=300%2C169 300w, https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/success.jpg?resize=768%2C432 768w, https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/success.jpg?w=1920 1920w, https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/success.jpg?w=1320 1320w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/a><\/p>\n<p>This is just scratching the surface of Selenium and I have more modules in the course to cover. \u00a0Next post, I&#8217;ll have some additional content from the next module (Selenium Web Driver) and possibly a little more.<\/p>\n<p>As always, if you have any questions or comments, please feel free to add them here or address them to john@benedettitech.com.<\/p>\n<p>Thanks for looking in!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, I&#8217;m making it through the Selenium\u00a0Pluralsight course\u00a0slowly but surely and I&#8217;m learning quite a bit so far. The first part covers a browser plug-in called\u00a0Selenium IDE. \u00a0Available only for Firefox, it&#8217;s essentially a session recording tool, \u00a0It records what we do in the browser then parses those into commands and then can be played &hellip; <a href=\"http:\/\/blog.benedettitech.com\/wp\/2016\/08\/15\/ui-unit-testing-with-selenium-part-1\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">UI Unit Testing with Selenium &#8211; Part 1<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"UI Unit Testing with Selenium - Part 1 #Selenium #ServiceNow","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[2],"tags":[7,15,16],"class_list":["post-205","post","type-post","status-publish","format-standard","hentry","category-development","tag-dotnet","tag-selenium","tag-testing"],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7dlOQ-3j","jetpack-related-posts":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/blog.benedettitech.com\/wp\/wp-json\/wp\/v2\/posts\/205","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.benedettitech.com\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.benedettitech.com\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.benedettitech.com\/wp\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.benedettitech.com\/wp\/wp-json\/wp\/v2\/comments?post=205"}],"version-history":[{"count":17,"href":"http:\/\/blog.benedettitech.com\/wp\/wp-json\/wp\/v2\/posts\/205\/revisions"}],"predecessor-version":[{"id":225,"href":"http:\/\/blog.benedettitech.com\/wp\/wp-json\/wp\/v2\/posts\/205\/revisions\/225"}],"wp:attachment":[{"href":"http:\/\/blog.benedettitech.com\/wp\/wp-json\/wp\/v2\/media?parent=205"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.benedettitech.com\/wp\/wp-json\/wp\/v2\/categories?post=205"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.benedettitech.com\/wp\/wp-json\/wp\/v2\/tags?post=205"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}