{"id":2843,"date":"2020-06-24T14:12:35","date_gmt":"2020-06-24T14:12:35","guid":{"rendered":"https:\/\/codoid.com\/selenium-chrome-headless-mode-overview\/"},"modified":"2022-02-04T18:35:27","modified_gmt":"2022-02-04T18:35:27","slug":"selenium-chrome-headless-mode-overview","status":"publish","type":"post","link":"https:\/\/codoid.com\/selenium-testing\/selenium-chrome-headless-mode-overview\/","title":{"rendered":"Selenium Chrome Headless Mode Overview"},"content":{"rendered":"<p>Selenium Chrome Headless Mode execution is not a new terminology. Nowadays, it is being used widely for <b>automation testing<\/b> and <b>web data scraping<\/b>. Selenium Chrome Headless mode is a great value add when you have GUI less test beds for automation script execution.<\/p>\n<p><a href=\"https:\/\/phantomjs.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">PhantomJs<\/a> used to be a very popular tool before Chrome headless implementation. However, present scenario  Chrome is the ideal choice for headless execution. There are two reasons &#8211; one is Chrome&#8217;s execution is much faster than PhantomJs and the next reason is Chrome is developed using Blink engine &#038; PhantomJS uses old web-kit engine. In this blog, article, you will learn how to run Selenium scripts in Chrome headless mode and how it mimics user actions.<\/p>\n<h3 class=\"widget-title\">What is Blink?<\/h3>\n<p>Blink is a browser engine and it is developed as part of the <a href=\"https:\/\/www.chromium.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">Chromium<\/a> project. All modern browsers these days are being developed using Blink browser engine. Headless Chrome uses the latest version of Blink. The popularity of blink is such that Microsoft has went to an extend of even discarding its own browser engine and started using Blink. Firefox uses Gecko engine and Safari uses Webkit. All other browsers are using Blink. Any browser which uses webkit engine lags a bit behind in terms of performance and stability.<\/p>\n<h3 class=\"widget-title\">PhantomJS Development is discontinued<\/h3>\n<p>PhantomJS was single handedly developed by a developer by named <b>Vitaly Slobodin<\/b>. After Chrome headless is being launched PhantomJS has become obsolete. Because Chrome headless is much faster than PhatomJS. As we all know that Webkit is older engine compared to Blink. Chrome Headless uses Blink and PhantomJS used Webkit. It has been officially announced that PhantomJS development is discontinued.<\/p>\n<h3 class=\"widget-title\">Code Example<\/h3>\n<div class=\"editor editor-dark\">\n<div class=\"editor-top\">\n<ul class=\"editor-controls\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<\/div>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nfrom selenium import webdriver\r\n\r\noptions = webdriver.ChromeOptions()\r\noptions.add_argument(&quot;--headless&quot;)\r\n\r\ndriver = webdriver.Chrome(chrome_options=options)\r\n  <\/pre>\n<\/div>\n<h3 class=\"widget-title\">Does Chrome headless mimic real user?<\/h3>\n<p>Chrome headless mode does not mimic real user. However, you can use it for test data creation scripts, prerequisite and web data scraping. Based on your automation testing requirements, you can decide which mode is suitable for your objective.<\/p>\n<h3 class=\"widget-title\">Conclusion<\/h3>\n<p>We, as a <a href=\"https:\/\/codoid.com\/automation-testing-services\/\">test automation services company<\/a>, use Selenium Chrome headless mode for various turn key projects. Whereas, the objectives are different for different projects. For instance: In one of the projects, we use headless mode to trigger JavaScripts events and verify them on Analytics platform. It can also be used for a different perspective altogether. We hope you have relished reading this blog article.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Selenium Chrome Headless Mode execution is not a new terminology. Nowadays, it is being used widely for automation testing and web data scraping. Selenium Chrome Headless mode is a great value add when you have GUI less test beds for automation script execution. PhantomJs used to be a very popular tool before Chrome headless implementation. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5264,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[187,179,20],"tags":[],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.3 (Yoast SEO v20.3) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Selenium Chrome Headless Mode Overview - Codoid<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Selenium Chrome Headless Mode Overview\" \/>\n<meta property=\"og:description\" content=\"Selenium Chrome Headless Mode execution is not a new terminology. Nowadays, it is being used widely for automation testing and web data scraping. Selenium Chrome Headless mode is a great value add when you have GUI less test beds for automation script execution. PhantomJs used to be a very popular tool before Chrome headless implementation. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/codoid.com\/learn\/selenium-testing\/selenium-chrome-headless-mode-overview\/\" \/>\n<meta property=\"og:site_name\" content=\"Codoid\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codoid.softwaretestingcompany\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-24T14:12:35+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-02-04T18:35:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/codoid.com\/wp-content\/uploads\/2020\/06\/Selenium_Chrome_Headless_Mode_Blog.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"800\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@codoid\" \/>\n<meta name=\"twitter:site\" content=\"@codoid\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Selenium Chrome Headless Mode Overview - Codoid","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"Selenium Chrome Headless Mode Overview","og_description":"Selenium Chrome Headless Mode execution is not a new terminology. Nowadays, it is being used widely for automation testing and web data scraping. Selenium Chrome Headless mode is a great value add when you have GUI less test beds for automation script execution. PhantomJs used to be a very popular tool before Chrome headless implementation. [&hellip;]","og_url":"https:\/\/codoid.com\/learn\/selenium-testing\/selenium-chrome-headless-mode-overview\/","og_site_name":"Codoid","article_publisher":"https:\/\/www.facebook.com\/codoid.softwaretestingcompany","article_published_time":"2020-06-24T14:12:35+00:00","article_modified_time":"2022-02-04T18:35:27+00:00","og_image":[{"width":1200,"height":800,"url":"https:\/\/codoid.com\/wp-content\/uploads\/2020\/06\/Selenium_Chrome_Headless_Mode_Blog.png","type":"image\/png"}],"author":"admin","twitter_card":"summary_large_image","twitter_creator":"@codoid","twitter_site":"@codoid","twitter_misc":{"Written by":"admin","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/codoid.com\/learn\/selenium-testing\/selenium-chrome-headless-mode-overview\/#article","isPartOf":{"@id":"https:\/\/codoid.com\/learn\/selenium-testing\/selenium-chrome-headless-mode-overview\/"},"author":{"name":"admin","@id":"https:\/\/codoid.com\/#\/schema\/person\/360ee1d38151acb7c746787fbfa8e586"},"headline":"Selenium Chrome Headless Mode Overview","datePublished":"2020-06-24T14:12:35+00:00","dateModified":"2022-02-04T18:35:27+00:00","mainEntityOfPage":{"@id":"https:\/\/codoid.com\/learn\/selenium-testing\/selenium-chrome-headless-mode-overview\/"},"wordCount":415,"commentCount":0,"publisher":{"@id":"https:\/\/codoid.com\/#organization"},"articleSection":["Selenium Testing","Fixed","Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/codoid.com\/learn\/selenium-testing\/selenium-chrome-headless-mode-overview\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/codoid.com\/learn\/selenium-testing\/selenium-chrome-headless-mode-overview\/","url":"https:\/\/codoid.com\/learn\/selenium-testing\/selenium-chrome-headless-mode-overview\/","name":"Selenium Chrome Headless Mode Overview - Codoid","isPartOf":{"@id":"https:\/\/codoid.com\/#website"},"datePublished":"2020-06-24T14:12:35+00:00","dateModified":"2022-02-04T18:35:27+00:00","breadcrumb":{"@id":"https:\/\/codoid.com\/learn\/selenium-testing\/selenium-chrome-headless-mode-overview\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codoid.com\/learn\/selenium-testing\/selenium-chrome-headless-mode-overview\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/codoid.com\/learn\/selenium-testing\/selenium-chrome-headless-mode-overview\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/codoid.com\/"},{"@type":"ListItem","position":2,"name":"Selenium Chrome Headless Mode Overview"}]},{"@type":"WebSite","@id":"https:\/\/codoid.com\/#website","url":"https:\/\/codoid.com\/","name":"Codoid","description":"","publisher":{"@id":"https:\/\/codoid.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/codoid.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/codoid.com\/#organization","name":"Codoid - Software Testing Company","url":"https:\/\/codoid.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codoid.com\/#\/schema\/logo\/image\/","url":"https:\/\/codoid.com\/wp-content\/uploads\/2020\/09\/Codoid_Software_Testing_Company_Logo.png","contentUrl":"https:\/\/codoid.com\/wp-content\/uploads\/2020\/09\/Codoid_Software_Testing_Company_Logo.png","width":500,"height":500,"caption":"Codoid - Software Testing Company"},"image":{"@id":"https:\/\/codoid.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codoid.softwaretestingcompany","https:\/\/twitter.com\/codoid","https:\/\/www.instagram.com\/codoid.softwaretestingcompany\/","https:\/\/www.linkedin.com\/company\/codoid-qacompany","https:\/\/www.pinterest.com\/codoid9282\/codoid-software-testing-company\/","https:\/\/www.youtube.com\/channel\/UCCmOTDQgcf4W8oo22mBMUYA"]},{"@type":"Person","@id":"https:\/\/codoid.com\/#\/schema\/person\/360ee1d38151acb7c746787fbfa8e586","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codoid.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/4d33f9036c9d60684b9478f738779823?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4d33f9036c9d60684b9478f738779823?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/codoid.com"]}]}},"_links":{"self":[{"href":"https:\/\/codoid.com\/wp-json\/wp\/v2\/posts\/2843"}],"collection":[{"href":"https:\/\/codoid.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codoid.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codoid.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codoid.com\/wp-json\/wp\/v2\/comments?post=2843"}],"version-history":[{"count":4,"href":"https:\/\/codoid.com\/wp-json\/wp\/v2\/posts\/2843\/revisions"}],"predecessor-version":[{"id":11515,"href":"https:\/\/codoid.com\/wp-json\/wp\/v2\/posts\/2843\/revisions\/11515"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codoid.com\/wp-json\/wp\/v2\/media\/5264"}],"wp:attachment":[{"href":"https:\/\/codoid.com\/wp-json\/wp\/v2\/media?parent=2843"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codoid.com\/wp-json\/wp\/v2\/categories?post=2843"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codoid.com\/wp-json\/wp\/v2\/tags?post=2843"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}