{"id":299,"date":"2014-07-07T11:29:51","date_gmt":"2014-07-07T11:29:51","guid":{"rendered":"http:\/\/www.ramandv.com\/blog\/?p=299"},"modified":"2014-07-07T11:31:29","modified_gmt":"2014-07-07T11:31:29","slug":"angularjs-protractor-selenium-headless-end-end-testing","status":"publish","type":"post","link":"http:\/\/www.ramandv.com\/blog\/angularjs-protractor-selenium-headless-end-end-testing\/","title":{"rendered":"Angularjs Protractor &#8211; Selenium headless End to End Testing"},"content":{"rendered":"\n<!-- Quick Adsense WordPress Plugin: http:\/\/quickadsense.com\/ -->\n<div class=\"e9e85ee105af8a6a4a383deebf1fa216\" data-index=\"1\" style=\"float: none; margin:10px 0 10px 0; text-align:center;\">\n<script type=\"text\/javascript\"><!--\r\ngoogle_ad_client = \"ca-pub-4917982260456644\";\r\n\/* ramandv.com-ad1 *\/\r\ngoogle_ad_slot = \"9226290554\";\r\ngoogle_ad_width = 728;\r\ngoogle_ad_height = 90;\r\n\/\/-->\r\n<\/script>\r\n<script type=\"text\/javascript\"\r\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\r\n<\/script>\n<\/div>\n<p>This post assumes that you know about protractor.<\/p>\n<h2>Scenario:<\/h2>\n<p>To setup the end to end testing in the server for continuous integration in Ubuntu.<\/p>\n<h2>Selenium Headless server installation:<\/h2>\n<ul>\n<li>Open the following ports 4444, 7054,5055 [If your continuous integration server is different from selenium server]<\/li>\n<li>Install Xvfb [Xvfb or X virtual framebuffer is a display server implementing the X11 display server protocol. In contrast to other display servers Xvfb performs all graphical operations in memory without showing any screen output.]<\/li>\n<\/ul>\n<blockquote>\n<pre><code>sudo aptitude install -y xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic xvfb x11-apps\n<\/code><\/pre>\n<\/blockquote>\n<ul>\n<li>Install imagemagick(to take screenshot), google-chrome and firefox<\/li>\n<\/ul>\n<blockquote>\n<pre><code>sudo aptitude imagemagick firefox google-chrome-stable\n<\/code><\/pre>\n<\/blockquote>\n<ul>\n<li>Now run the Xvfb server <\/li>\n<\/ul>\n<blockquote>\n<pre><code>\/usr\/bin\/Xvfb :99 -ac -screen 0 1024x768x24 &amp;\n<\/code><\/pre>\n<\/blockquote>\n<ul>\n<li>To make the x-windows apps to connect this Xvfb server, <\/li>\n<\/ul>\n<blockquote>\n<pre><code>export DISPLAY=:99\n<\/code><\/pre>\n<\/blockquote>\n<ul>\n<li>Now run the selenium server. When it launches the google-chrome or firefox , it will use the xvfb server.<\/li>\n<\/ul>\n<blockquote>\n<pre><code>node_modules\/protractor\/bin\/webdriver-manager start\n<\/code><\/pre>\n<\/blockquote>\n<h2>Debugging the selenium headless server installation:<\/h2>\n<ul>\n<li>First check whether the browsers are using the Xvfb, when your run in the command line. [when you run the command <code>firefox<\/code>, it will just throw some output and waits till you kill with ctl+C]<\/li>\n<li>then, Check whether selenium works or not, by visiting the the following URL<\/li>\n<\/ul>\n<blockquote>\n<pre><code>http:\/\/&lt;your_selenium_server&gt;:4444\/wd\/hub\/static\/resource\/hub.html\n<\/code><\/pre>\n<\/blockquote>\n<p><img src=\"http:\/\/www.ramandv.com\/blog\/wp-content\/uploads\/2014\/07\/WebDriver_Hub.png\" alt=\"Selenium server\" \/><\/p>\n<ol>\n<li>You can try to create session with different browsers. <\/li>\n<li>Click load script and enter some URL.<\/li>\n<li>Take screenshot, you should see the loaded page screenshot.<\/li>\n<\/ol>\n<h2>Configure protractor:<\/h2>\n<p>With the following<\/p>\n<blockquote>\n<pre><code>seleniumAddress: 'http:\/\/&lt;Your_selenium_server_address&gt;:4444\/wd\/hub'\n<\/code><\/pre>\n<\/blockquote>\n\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>This post assumes that you know about protractor. Scenario: To setup the end to end testing in the server for continuous integration in Ubuntu. Selenium Headless server installation: Open the following ports 4444, 7054,5055 [If your continuous integration server is &hellip; <a href=\"http:\/\/www.ramandv.com\/blog\/angularjs-protractor-selenium-headless-end-end-testing\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[7,6,24],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v17.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<meta name=\"description\" content=\"Selenium headless server installation in Ubuntu and how to debug the installation.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.ramandv.com\/blog\/angularjs-protractor-selenium-headless-end-end-testing\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Angularjs Protractor - Selenium headless End to End Testing - Articles for Developers\" \/>\n<meta property=\"og:description\" content=\"Selenium headless server installation in Ubuntu and how to debug the installation.\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.ramandv.com\/blog\/angularjs-protractor-selenium-headless-end-end-testing\/\" \/>\n<meta property=\"og:site_name\" content=\"Articles for Developers\" \/>\n<meta property=\"article:published_time\" content=\"2014-07-07T11:29:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-07-07T11:31:29+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.ramandv.com\/blog\/wp-content\/uploads\/2014\/07\/WebDriver_Hub.png\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"ramandv\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"http:\/\/www.ramandv.com\/blog\/#website\",\"url\":\"http:\/\/www.ramandv.com\/blog\/\",\"name\":\"Articles for Developers\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/www.ramandv.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"http:\/\/www.ramandv.com\/blog\/angularjs-protractor-selenium-headless-end-end-testing\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"http:\/\/www.ramandv.com\/blog\/wp-content\/uploads\/2014\/07\/WebDriver_Hub.png\",\"contentUrl\":\"http:\/\/www.ramandv.com\/blog\/wp-content\/uploads\/2014\/07\/WebDriver_Hub.png\",\"width\":863,\"height\":155},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/www.ramandv.com\/blog\/angularjs-protractor-selenium-headless-end-end-testing\/#webpage\",\"url\":\"http:\/\/www.ramandv.com\/blog\/angularjs-protractor-selenium-headless-end-end-testing\/\",\"name\":\"Angularjs Protractor - Selenium headless End to End Testing - Articles for Developers\",\"isPartOf\":{\"@id\":\"http:\/\/www.ramandv.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/www.ramandv.com\/blog\/angularjs-protractor-selenium-headless-end-end-testing\/#primaryimage\"},\"datePublished\":\"2014-07-07T11:29:51+00:00\",\"dateModified\":\"2014-07-07T11:31:29+00:00\",\"author\":{\"@id\":\"http:\/\/www.ramandv.com\/blog\/#\/schema\/person\/ca1ede7143462f244081566e6ff97658\"},\"description\":\"Selenium headless server installation in Ubuntu and how to debug the installation.\",\"breadcrumb\":{\"@id\":\"http:\/\/www.ramandv.com\/blog\/angularjs-protractor-selenium-headless-end-end-testing\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.ramandv.com\/blog\/angularjs-protractor-selenium-headless-end-end-testing\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/www.ramandv.com\/blog\/angularjs-protractor-selenium-headless-end-end-testing\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Angularjs Protractor &#8211; Selenium headless End to End Testing\"}]},{\"@type\":\"Person\",\"@id\":\"http:\/\/www.ramandv.com\/blog\/#\/schema\/person\/ca1ede7143462f244081566e6ff97658\",\"name\":\"ramandv\",\"url\":\"http:\/\/www.ramandv.com\/blog\/author\/ramandv\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"description":"Selenium headless server installation in Ubuntu and how to debug the installation.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/www.ramandv.com\/blog\/angularjs-protractor-selenium-headless-end-end-testing\/","og_locale":"en_US","og_type":"article","og_title":"Angularjs Protractor - Selenium headless End to End Testing - Articles for Developers","og_description":"Selenium headless server installation in Ubuntu and how to debug the installation.","og_url":"http:\/\/www.ramandv.com\/blog\/angularjs-protractor-selenium-headless-end-end-testing\/","og_site_name":"Articles for Developers","article_published_time":"2014-07-07T11:29:51+00:00","article_modified_time":"2014-07-07T11:31:29+00:00","og_image":[{"url":"http:\/\/www.ramandv.com\/blog\/wp-content\/uploads\/2014\/07\/WebDriver_Hub.png"}],"twitter_misc":{"Written by":"ramandv","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"http:\/\/www.ramandv.com\/blog\/#website","url":"http:\/\/www.ramandv.com\/blog\/","name":"Articles for Developers","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.ramandv.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"http:\/\/www.ramandv.com\/blog\/angularjs-protractor-selenium-headless-end-end-testing\/#primaryimage","inLanguage":"en-US","url":"http:\/\/www.ramandv.com\/blog\/wp-content\/uploads\/2014\/07\/WebDriver_Hub.png","contentUrl":"http:\/\/www.ramandv.com\/blog\/wp-content\/uploads\/2014\/07\/WebDriver_Hub.png","width":863,"height":155},{"@type":"WebPage","@id":"http:\/\/www.ramandv.com\/blog\/angularjs-protractor-selenium-headless-end-end-testing\/#webpage","url":"http:\/\/www.ramandv.com\/blog\/angularjs-protractor-selenium-headless-end-end-testing\/","name":"Angularjs Protractor - Selenium headless End to End Testing - Articles for Developers","isPartOf":{"@id":"http:\/\/www.ramandv.com\/blog\/#website"},"primaryImageOfPage":{"@id":"http:\/\/www.ramandv.com\/blog\/angularjs-protractor-selenium-headless-end-end-testing\/#primaryimage"},"datePublished":"2014-07-07T11:29:51+00:00","dateModified":"2014-07-07T11:31:29+00:00","author":{"@id":"http:\/\/www.ramandv.com\/blog\/#\/schema\/person\/ca1ede7143462f244081566e6ff97658"},"description":"Selenium headless server installation in Ubuntu and how to debug the installation.","breadcrumb":{"@id":"http:\/\/www.ramandv.com\/blog\/angularjs-protractor-selenium-headless-end-end-testing\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.ramandv.com\/blog\/angularjs-protractor-selenium-headless-end-end-testing\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/www.ramandv.com\/blog\/angularjs-protractor-selenium-headless-end-end-testing\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Angularjs Protractor &#8211; Selenium headless End to End Testing"}]},{"@type":"Person","@id":"http:\/\/www.ramandv.com\/blog\/#\/schema\/person\/ca1ede7143462f244081566e6ff97658","name":"ramandv","url":"http:\/\/www.ramandv.com\/blog\/author\/ramandv\/"}]}},"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6YZCe-4P","_links":{"self":[{"href":"http:\/\/www.ramandv.com\/blog\/wp-json\/wp\/v2\/posts\/299"}],"collection":[{"href":"http:\/\/www.ramandv.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.ramandv.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.ramandv.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.ramandv.com\/blog\/wp-json\/wp\/v2\/comments?post=299"}],"version-history":[{"count":3,"href":"http:\/\/www.ramandv.com\/blog\/wp-json\/wp\/v2\/posts\/299\/revisions"}],"predecessor-version":[{"id":303,"href":"http:\/\/www.ramandv.com\/blog\/wp-json\/wp\/v2\/posts\/299\/revisions\/303"}],"wp:attachment":[{"href":"http:\/\/www.ramandv.com\/blog\/wp-json\/wp\/v2\/media?parent=299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.ramandv.com\/blog\/wp-json\/wp\/v2\/categories?post=299"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.ramandv.com\/blog\/wp-json\/wp\/v2\/tags?post=299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}