{"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 decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.seleniumhq.org\/images\/big-logo.png?w=660\" data-recalc-dims=\"1\" \/><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-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-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"selenium\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/selenium.jpg?fit=300%2C169\" data-large-file=\"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/selenium.jpg?fit=660%2C371\" decoding=\"async\" loading=\"lazy\" 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=\"(max-width: 660px) 100vw, 660px\" data-recalc-dims=\"1\" \/><\/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-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-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"newtest\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/newtest.jpg?fit=300%2C154\" data-large-file=\"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/newtest.jpg?fit=660%2C338\" decoding=\"async\" loading=\"lazy\" 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=\"(max-width: 660px) 100vw, 660px\" data-recalc-dims=\"1\" \/><\/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-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;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}\" data-image-title=\"finishedtest\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/finishedtest.jpg?fit=300%2C154\" data-large-file=\"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/finishedtest.jpg?fit=660%2C338\" decoding=\"async\" loading=\"lazy\" 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=\"(max-width: 660px) 100vw, 660px\" data-recalc-dims=\"1\" \/><\/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-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-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"success\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/success.jpg?fit=300%2C169\" data-large-file=\"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/success.jpg?fit=660%2C371\" decoding=\"async\" loading=\"lazy\" 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=\"(max-width: 660px) 100vw, 660px\" data-recalc-dims=\"1\" \/><\/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_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"UI Unit Testing with Selenium - Part 1 #Selenium #ServiceNow","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[2],"tags":[7,15,16],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7dlOQ-3j","jetpack-related-posts":[{"id":229,"url":"http:\/\/blog.benedettitech.com\/wp\/2016\/08\/22\/ui-unit-testing-with-selenium-part-2-webdriver-basics\/","url_meta":{"origin":205,"position":0},"title":"UI Unit Testing with Selenium &#8211; Part 2 &#8211; Webdriver Basics","date":"August 22, 2016","format":false,"excerpt":"Last time, I did a quick run-through of Selenium IDE for Firefox and got acquainted with the interface and commands associated with Selenium. \u00a0This time, I'm diving more into the meat of the framework and using Webdriver. Webdriver is an API for that can be used by various languages (C#,\u2026","rel":"","context":"In &quot;Development&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/08\/seleniumexport.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":285,"url":"http:\/\/blog.benedettitech.com\/wp\/2017\/01\/02\/ui-unit-testing-with-selenium-part-4-selenium-server\/","url_meta":{"origin":205,"position":1},"title":"UI Unit Testing with Selenium \u2013 Part 4 \u2013 Selenium Server","date":"January 2, 2017","format":false,"excerpt":"\u00a0 Last time, I went over more advanced uses of Webdriver as well as putting together a framework of shared methods which can be hooked up to unit tests. For this last post, I'll be standing up an instance of Selenium Server on Amazon Web Services and refactoring the test\u2026","rel":"","context":"In &quot;Development&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/12\/EC2-1024x322.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":183,"url":"http:\/\/blog.benedettitech.com\/wp\/2016\/08\/08\/ui-unit-testing-with-selenium-an-experiment\/","url_meta":{"origin":205,"position":2},"title":"UI Unit Testing with Selenium &#8211; An Experiment","date":"August 8, 2016","format":false,"excerpt":"It's been a while since I've posted. \u00a0Part writers block and part outside obligations. \u00a0I know you've all been despondent and lost in the meantime. \u00a0Sorry about that. :) Something that's a recurring puzzle for me is adapting unit testing to MVC and SaaS solutions. \u00a0 The challenges from my\u2026","rel":"","context":"In &quot;Development&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":262,"url":"http:\/\/blog.benedettitech.com\/wp\/2016\/11\/28\/ui-unit-testing-with-selenium-part-3-advanced-webdriver-a-real-world-example\/","url_meta":{"origin":205,"position":3},"title":"UI Unit Testing with Selenium &#8211; Part 3 &#8211; Advanced Webdriver &#038; A Real World Example","date":"November 28, 2016","format":false,"excerpt":"Last time, I\u00a0got into the basics of Webdriver and put together a couple of tests against ServiceNow. \u00a0For this post, I'm going to take a look at more advanced uses of Webdriver as well as putting together a framework of shared methods which can be hooked up to unit tests.\u2026","rel":"","context":"In &quot;Development&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2016\/10\/PrivateLogin.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":333,"url":"http:\/\/blog.benedettitech.com\/wp\/2017\/03\/20\/why-earn-certifications-ill-tell-you\/","url_meta":{"origin":205,"position":4},"title":"Why Earn Certifications? I&#8217;ll Tell You..","date":"March 20, 2017","format":false,"excerpt":"Last post, I shared a story about earning my Certified ScrumMaster badge. Often, I'll have conversations with other IT professionals about the usefulness of certifications and whether or not to pursue them. The common conclusion, as with most things in this business, is 'It Depends.' When I was first starting\u2026","rel":"","context":"In &quot;Certifications&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.benedettitech.com\/wp\/wp-content\/uploads\/2017\/03\/Aplus-Logo-Certified-300x275.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":302,"url":"http:\/\/blog.benedettitech.com\/wp\/2017\/01\/30\/servicenow-istanbul-whats-new\/","url_meta":{"origin":205,"position":5},"title":"ServiceNow Istanbul &#8211; What&#8217;s New?","date":"January 30, 2017","format":false,"excerpt":"If it's not obvious from my most recent content, I've been spending the bulk of my time in ServiceNow. \u00a0For those of you who don't know, ServiceNow is an enterprise application platform that is commonly used for its flagship ITSM\/ITIL application. \u00a0While IT Service Management\u00a0is its main use, the platform\u2026","rel":"","context":"In &quot;Development&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/blog.benedettitech.com\/wp\/wp-json\/wp\/v2\/posts\/205"}],"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}]}}