<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: 17thSep</title>
    <description>The latest articles on DEV Community by 17thSep (@17thsep1).</description>
    <link>https://dev.to/17thsep1</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F535570%2F256ad999-2035-4848-bccb-2422dbb3db0f.jpg</url>
      <title>DEV Community: 17thSep</title>
      <link>https://dev.to/17thsep1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/17thsep1"/>
    <language>en</language>
    <item>
      <title>Create your first WDIO Automation script with Typescript</title>
      <dc:creator>17thSep</dc:creator>
      <pubDate>Mon, 01 Mar 2021 15:16:33 +0000</pubDate>
      <link>https://dev.to/17thsep1/create-your-first-wdio-automation-script-with-typescript-4e4p</link>
      <guid>https://dev.to/17thsep1/create-your-first-wdio-automation-script-with-typescript-4e4p</guid>
      <description>&lt;p&gt;In this article, we will take a look at how you can create your first automation script using webdriverio in &lt;/p&gt;

&lt;p&gt;If you are new to Typescript look at the basics &lt;a href="https://dev.to/17thsep1/typescript-basics-for-automation-45j0"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Standalone Mode&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Using Typescript&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Using Configuration helpers&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you need to visually see all these ways developed refer to this video below&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/QT3UeCI0H2Q"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Also, take a look at the sample script in the github link &lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--i3JOwpme--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-ba8488d21cd8ee1fee097b8410db9deaa41d0ca30b004c0c63de0a479114156f.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/17thSep"&gt;
        17thSep
      &lt;/a&gt; / &lt;a href="https://github.com/17thSep/WebdriverIO_Master"&gt;
        WebdriverIO_Master
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      This is the core branch for WebdriverIO by Ap.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
WebdriverIO_Master&lt;/h1&gt;
&lt;p&gt;This is the core branch for WebdriverIO, take a look at each of the folders&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/17thSep/WebdriverIO_Master/tree/master/TypeScript/BasicTypeScript"&gt;1. BasicTypeScript&lt;/a&gt; - Only TypeScript&lt;br&gt;
&lt;a href="https://github.com/17thSep/WebdriverIO_Master/tree/master/TypeScript/Cucumber"&gt;2. Cucumber&lt;/a&gt;                - WDIO 7 scripts with typescript in Cucumber Framework&lt;br&gt;
&lt;a href="https://github.com/17thSep/WebdriverIO_Master/tree/master/TypeScript/Mocha"&gt;3. Mocha&lt;/a&gt;           - WDIO 7 scripts with typescript in Mocha Framework&lt;br&gt;
&lt;a href="https://github.com/17thSep/WebdriverIO_Master/tree/master/TypeScript/Docker"&gt;4. Docker&lt;/a&gt;         - Run WDIO 7 script in Docker&lt;br&gt;
&lt;a href="https://github.com/17thSep/WebdriverIO_Master/tree/master/TypeScript/NetworkLogs"&gt;5. Networklogs&lt;/a&gt;     - Capture Network logs&lt;br&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;More to follow
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;
Watch WDIO7 videos&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://youtu.be/U3kOuNxvlk4" rel="nofollow"&gt;Basics of Typescript&lt;/a&gt;&lt;br&gt;
&lt;a href="https://youtu.be/QT3UeCI0H2Q" rel="nofollow"&gt;Create your first Mocha scripts with TypeScript&lt;/a&gt;&lt;br&gt;
Create your Cucumber scripts with TypeScript&lt;br&gt;
Run scripts in Docker (GRID+NODE)&lt;br&gt;
Run scripts in Docker (IMAGES)&lt;br&gt;
Capture Network logs&lt;br&gt;&lt;/p&gt;
&lt;h3&gt;
Watch WDIO 6 videos &lt;br&gt;
&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://youtu.be/NDt4alzH5E0" rel="nofollow"&gt;Run scripts in Docker (GRID+NODE)&lt;/a&gt;&lt;br&gt;
&lt;a href="https://youtu.be/Yjg476fg1l0" rel="nofollow"&gt;Run scripts in Docker (IMAGES)&lt;/a&gt;&lt;br&gt;
&lt;a href="https://youtu.be/Be9IPyxHmLs" rel="nofollow"&gt;Capture Network logs&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;h3&gt;
Alternatively,&lt;/h3&gt;
&lt;p&gt;Take a look at the WatchVideo.md file inside each folder for the step by step instructions&lt;/p&gt;
&lt;h2&gt;
If you like to support my work, please check out the below&lt;/h2&gt;
&lt;p&gt;Patreon: &lt;a href="https://www.patreon.com/17thsep/membership" rel="nofollow"&gt;https://www.patreon.com/17thsep/membership&lt;/a&gt; &lt;br&gt;
Youtube: &lt;a href="https://www.youtube.com/channel/UCqaDA1xslraCbam2CxuKhUw" rel="nofollow"&gt;https://www.youtube.com/channel/UCqaDA1xslraCbam2CxuKhUw&lt;/a&gt; &lt;br&gt;
Dev.to: &lt;a href="https://dev.to/17thsep1" rel="nofollow"&gt;https://dev.to/17thsep1&lt;/a&gt; &lt;br&gt;
&lt;/p&gt;

&lt;/div&gt;
&lt;br&gt;
&lt;br&gt;
  &lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/17thSep/WebdriverIO_Master"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;h1&gt;
  
  
  Standalone Mode
&lt;/h1&gt;

&lt;p&gt;Standalone can be picturized like an engine of the car, you have what you need to run but this will be easier to drive if you have all the necessary parts. &lt;/p&gt;

&lt;p&gt;With all those necessary parts put together, we can develop our framework which is the Test Runner Mode.&lt;/p&gt;

&lt;p&gt;Standalone Mode needs just one dependency &lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm i webdriverio&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After you have installed this, you can write the asynchronous way of scripting for your automation scripts. &lt;/p&gt;

&lt;p&gt;If you need to write it in a synchronous way that's when you will need &lt;code&gt;@wdio/sync&lt;/code&gt; library which the WebdriverIO team has designed.&lt;/p&gt;

&lt;h1&gt;
  
  
  TypeScript Setup
&lt;/h1&gt;

&lt;p&gt;Test runner mode is the complete product where we can leverage the modules developed for specific purposes rather than developing them all by us.&lt;/p&gt;

&lt;p&gt;We need 4 main steps to do this&lt;/p&gt;

&lt;p&gt;1 - Install all the dependencies&lt;br&gt;
2 - Create a WDIO config file&lt;br&gt;
3 - Develop Automation scripts&lt;br&gt;
4 - Tsconfig.json {Only needed if you choose typescript}&lt;/p&gt;

&lt;h2&gt;
  
  
  Dependencies
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"@wdio/cli": "^7.0.8",&lt;br&gt;
"@wdio/dot-reporter": "^7.0.7",&lt;br&gt;
"@wdio/local-runner": "^7.0.8",&lt;br&gt;
"@wdio/mocha-framework": "^7.0.7",&lt;br&gt;
"@wdio/sync": "^7.0.8",&lt;br&gt;
"chromedriver": "^88.0.0",&lt;br&gt;
"ts-node": "^9.1.1", {Only for typescript}&lt;br&gt;
"typescript": "^4.2.2",{Only for typescript}&lt;br&gt;
"wdio-chromedriver-service": "^7.0.0" &lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  WDIO Config file&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;A basic config file will have these elements below.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;autoCompileOpts&lt;/code&gt; shown below is necessary for typescript to work seamlessly&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ao9TXYHu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wu095ejpugdl4vahgdyy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ao9TXYHu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wu095ejpugdl4vahgdyy.png" alt="Screenshot 2021-03-01 at 15.12.18"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Sample Script
&lt;/h2&gt;

&lt;p&gt;Once we have it all done we have our automation scripts ready.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--N-Iam3qk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o3ckhu18y3g3t2wad4ra.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--N-Iam3qk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o3ckhu18y3g3t2wad4ra.png" alt="Screenshot 2021-03-01 at 15.13.22"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Tsconfig.json
&lt;/h2&gt;

&lt;p&gt;The one main difference to creating scripts with Typescript is that &lt;/p&gt;

&lt;p&gt;you need to create a tsconfig.json which serves as the controller for how you want typescript to behave. A sample tsconfig file will have the below &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tPyKF5PP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p88e81io3oa277ygpwt9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tPyKF5PP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p88e81io3oa277ygpwt9.png" alt="Screenshot 2021-03-01 at 14.53.29"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I will talk about 2 main sections here&lt;/p&gt;

&lt;h4&gt;
  
  
  types
&lt;/h4&gt;

&lt;p&gt;Whatever library which you include here, typescript will let you verify your scripting is as per the definitions inside these libraries. For e.g. if you have not included "@wdio/mocha-framework" in here, when you write scripts in the files in the include section below Typescript will warn you for definition not found error.&lt;/p&gt;

&lt;h4&gt;
  
  
  include
&lt;/h4&gt;

&lt;p&gt;This is a list of file for which we need typescript to do a type check&lt;/p&gt;

&lt;h3&gt;
  
  
  WDIO Configuration Helper
&lt;/h3&gt;

&lt;p&gt;If you find doing this tough, that's when the &lt;code&gt;WDIO Configuration helper&lt;/code&gt; comes in&lt;/p&gt;

&lt;p&gt;You can access that after installing @wdio/cli by typing in &lt;/p&gt;

&lt;p&gt;&lt;code&gt;npx wdio config&lt;/code&gt;  - if you want to choose the options&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npx wdio config -y&lt;/code&gt; - if you want to get some basic automation script running&lt;/p&gt;

&lt;p&gt;Cheers&lt;br&gt;
Ap.&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>webdriverio</category>
      <category>webdriveriotutorials</category>
      <category>learnwebdriverio</category>
    </item>
    <item>
      <title>TypeScript Basics for Automation</title>
      <dc:creator>17thSep</dc:creator>
      <pubDate>Mon, 15 Feb 2021 16:21:46 +0000</pubDate>
      <link>https://dev.to/17thsep1/typescript-basics-for-automation-45j0</link>
      <guid>https://dev.to/17thsep1/typescript-basics-for-automation-45j0</guid>
      <description>&lt;p&gt;Typescript is the buzzword in the javaScript world without a doubt. The question do Quality Engineers dealing with nodejs automation with tools like WebdriverIO, Cypress, Playwright, Protractor, Puppeteer need to get on to that wagon?&lt;/p&gt;

&lt;p&gt;The short answer is, Yes definitely.&lt;/p&gt;

&lt;p&gt;In this video below, I have explained the basics of typescript and these points&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Shortcomings in javascript&lt;/li&gt;
&lt;li&gt;How to configure Typescript&lt;/li&gt;
&lt;li&gt;TypeScript Example&lt;/li&gt;
&lt;li&gt;tsc TypeScript compiler&lt;/li&gt;
&lt;li&gt;What is ts-node&lt;/li&gt;
&lt;li&gt;tsconfig.json&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/U3kOuNxvlk4"&gt;
&lt;/iframe&gt;
&lt;br&gt;
Cheers&lt;br&gt;
Ap.&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>node</category>
      <category>automation</category>
      <category>javascript</category>
    </item>
    <item>
      <title>How does WebdriverIO work</title>
      <dc:creator>17thSep</dc:creator>
      <pubDate>Tue, 02 Feb 2021 10:09:42 +0000</pubDate>
      <link>https://dev.to/17thsep1/how-does-webdriverio-work-1b9g</link>
      <guid>https://dev.to/17thsep1/how-does-webdriverio-work-1b9g</guid>
      <description>&lt;p&gt;Sooooooo the elements of a Webdriverio Automation framework, what does it have?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WK68C4rC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ebydhkqlkqyl7y6ud6sk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WK68C4rC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ebydhkqlkqyl7y6ud6sk.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Of course, we need a &lt;code&gt;browser&lt;/code&gt;  where we can execute our scripts&lt;/p&gt;

&lt;p&gt;An environment, &lt;code&gt;Node.js&lt;/code&gt; where we can write scripts to pass commands&lt;/p&gt;

&lt;p&gt;An &lt;code&gt;IDE&lt;/code&gt;, Vscode where we can edit and write code efficiently with various extensions&lt;/p&gt;

&lt;p&gt;A scripting language, &lt;code&gt;Javascript&lt;/code&gt; or &lt;code&gt;Typescript&lt;/code&gt; which the Node.js platform understands&lt;/p&gt;

&lt;p&gt;A bunch of libraries/node modules &lt;code&gt;Webdiverio Pupetteer Allurereports Cucumber&lt;/code&gt; etc.. to help achieve the various task we are wanting to achieve&lt;/p&gt;

&lt;p&gt;Put this all together &lt;strong&gt;...Booommmm!&lt;/strong&gt; We can achieve what we want to in Automation&lt;/p&gt;

&lt;p&gt;Since webdriverIO is Node.js based we have the entry into &lt;code&gt;package.json&lt;/code&gt; first from there the control shifts to the &lt;code&gt;wdio config file&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Config file&lt;/code&gt; is the control room of this Automation execution with this js file holding all the critical information like &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;what browser&lt;/li&gt;
&lt;li&gt;how many browsers&lt;/li&gt;
&lt;li&gt;what files to test&lt;/li&gt;
&lt;li&gt;where are the test files located&lt;/li&gt;
&lt;li&gt;what framework&lt;/li&gt;
&lt;li&gt;what kind of reports&lt;/li&gt;
&lt;li&gt;where to run 
etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finally, when we try to execute the scripts by entering &lt;code&gt;npm test&lt;/code&gt; in the terminal then the terminal transfers this to npm which will inturn search in the package.json&lt;/p&gt;

&lt;p&gt;Once the specific command is executed {usually to run the config file with node} then the flow goes to the config which then handles the rest.&lt;/p&gt;

&lt;p&gt;Cool, If you are interested in learning more about webdriverio, keep a watch here or my youtube channel&lt;/p&gt;

&lt;p&gt;You can watch all this with a small demo in the below video &lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/iW43mznyZnA"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Cheers!&lt;br&gt;
Ap&lt;/p&gt;

</description>
      <category>webdriverio</category>
      <category>learnwebdriverio</category>
      <category>webdriveriotutorials</category>
      <category>wdio</category>
    </item>
    <item>
      <title>Capture Network logs using WebdriverIO </title>
      <dc:creator>17thSep</dc:creator>
      <pubDate>Sat, 23 Jan 2021 08:45:08 +0000</pubDate>
      <link>https://dev.to/17thsep1/capture-network-logs-using-webdriverio-21lo</link>
      <guid>https://dev.to/17thsep1/capture-network-logs-using-webdriverio-21lo</guid>
      <description>&lt;p&gt;Capturing network logs is something that is key to complete automation. &lt;/p&gt;

&lt;p&gt;Often testers are left with the black box of not knowing when a call is being made while going the automation route, with this tool WebdriverIO using the Chrome dev tools protocol via puppeteer it becomes easy for us to achieve that. &lt;/p&gt;

&lt;p&gt;We can achieve automation of request analysis and also verify if the requests are made at the right place.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to do it with WebdriverIO&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ensure you are running this with &lt;code&gt;Chrome&lt;/code&gt; browser as this is not available for all the browsers&lt;/p&gt;

&lt;p&gt;There are no additional changes required in your &lt;code&gt;wdio.conf.js&lt;/code&gt; file&lt;/p&gt;

&lt;p&gt;There are no additional libraries required as well&lt;/p&gt;

&lt;p&gt;For you to capture a specific type of requests the control lies in browser.mock section&lt;/p&gt;

&lt;p&gt;Example for when you want to capture all &lt;code&gt;GET&lt;/code&gt; calls &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    var output = browser.mock('**',{method:'get'})
    browser.url('https://reqres.in')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Example for when you want to capture all &lt;code&gt;POST&lt;/code&gt; calls &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    var output = browser.mock('**',{method:'post'})
    browser.url('https://reqres.in')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Example for when you want to capture any &lt;code&gt;POST&lt;/code&gt; calls that end with &lt;code&gt;login&lt;/code&gt; in the request URL&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    var output1 = browser.mock('**/login',{method:'post'})
    browser.url('https://the-internet.herokuapp.com/login')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Example for when you want to capture any &lt;code&gt;POST&lt;/code&gt; calls that end with &lt;code&gt;authenticate&lt;/code&gt; in the request URL&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    var output2 = browser.mock('**/authenticate',{method:'post'})
    browser.url('https://the-internet.herokuapp.com/login')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Example for when you want to capture any &lt;code&gt;GET&lt;/code&gt; calls that end with &lt;code&gt;api/users/2&lt;/code&gt; in the request URL&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    var output3 = browser.mock('**/api/users/2',{method:'get'})
    browser.url('https://reqres.in')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Once you specify a URL to capture, it will capture all the calls that are made let's say if you made 5 calls all 5 will be captured as a separate object inside that variable in JSON format.&lt;/p&gt;

&lt;p&gt;In this video below I have gone about explaining all of the above scenarios and how to automate them. Hope you'll like it&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Be9IPyxHmLs"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Br,&lt;br&gt;
Ap.&lt;/p&gt;

</description>
      <category>webdriverio</category>
      <category>automation</category>
      <category>capturenetworklogs</category>
      <category>devtools</category>
    </item>
    <item>
      <title>WebdriverIO 6.0 + Docker + Create your own docker image</title>
      <dc:creator>17thSep</dc:creator>
      <pubDate>Sun, 27 Dec 2020 00:03:34 +0000</pubDate>
      <link>https://dev.to/17thsep1/webdriverio-6-0-docker-create-your-own-docker-image-2k74</link>
      <guid>https://dev.to/17thsep1/webdriverio-6-0-docker-create-your-own-docker-image-2k74</guid>
      <description>&lt;p&gt;At the end of this article, you will be able to create your own image and execute your automation scripts in a docker container.&lt;/p&gt;

&lt;h2&gt;
  
  
  Table Of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Objective&lt;/li&gt;
&lt;li&gt;Approach&lt;/li&gt;
&lt;li&gt;Dockerfile&lt;/li&gt;
&lt;li&gt;Execution&lt;/li&gt;
&lt;li&gt;Mounting Volumes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Yjg476fg1l0"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  Objective &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Below are a few points which summarizes what we are trying to do: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I need to run my automation scripts in a docker container&lt;/li&gt;
&lt;li&gt;I don't have to create multiple images every time I make a change&lt;/li&gt;
&lt;li&gt;use the memory available efficiently&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Approach&lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;In the previous article &lt;/p&gt;
&lt;div class="ltag__link"&gt;
  &lt;a href="/17thsep1" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wolvDT-P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--UQ2pclvc--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/535570/256ad999-2035-4848-bccb-2422dbb3db0f.jpg" alt="17thsep1 image"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/17thsep1/webdriverio-6-0-docker-selenium-hub-4-0-l4m" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;WebdriverIO 6.0 + Docker + Selenium Hub 4.0&lt;/h2&gt;
      &lt;h3&gt;17thSep ・ Dec 12 '20 ・ 4 min read&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#webdriverio&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#docker&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#selenium&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#automation&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;
 we discussed how we can leverage docker images by docker selenium. Here, we will explain how we can create an image and run it

&lt;ul&gt;
&lt;li&gt;mount a volume from local machine to container&lt;/li&gt;
&lt;li&gt;make changes locally and run it in a container&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Dockerfile &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The first step is to have your automation scripts ready. Once the script is ready ensure we have the configuration to run it in headless mode. You can do so by adding the below in your wdio config file&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vzVgdRo9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/m63xwuwzaild63zq49do.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vzVgdRo9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/m63xwuwzaild63zq49do.png" alt="Screenshot 2020-12-26 at 23.15.03"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is because the chromium-browser in Debian primarily runs in headless mode, moreover, it's the headless browser that we have used in the docker image.&lt;/p&gt;

&lt;p&gt;ok, that's done. Let's crack on.&lt;/p&gt;

&lt;p&gt;If you take a look at the Dockerfile, with the node image as the base, we have installed a few libraries and fonts followed by the chrome browser. &lt;/p&gt;

&lt;p&gt;Once we have the base, we then set the working directory and copy all the files, and do an npm install to get the os specific node modules.&lt;/p&gt;

&lt;p&gt;An important point to consider here is that the chrome driver for mac or windows will not work for the Debian version. So whatever node modules we have should not be carried over to the image, one way to prevent that from happening is to create a .dockerignore file and add node_modules to it. &lt;br&gt;
Again if you have any queries refer to the git hub URL provided below and search for the .dockerignore file.&lt;/p&gt;

&lt;p&gt;The final step is to mention the ENTRY POINT. Since the scripts get triggered as soon as we run the image to get the container it's a necessity for us to give the npm test command or npm run  which points to the wdio config file.&lt;/p&gt;

&lt;p&gt;This completes the docker file creation. You can refer to that docker file from the below link&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/17thSep/WDIO6_Docker_Custom_Image/blob/master/Dockerfile"&gt;https://github.com/17thSep/WDIO6_Docker_Custom_Image/blob/master/Dockerfile&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Or refer to the screenshot below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jt7uJB_f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/b7lwozctio6ptin0hdtg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jt7uJB_f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/b7lwozctio6ptin0hdtg.png" alt="Screenshot 2020-12-22 at 17.28.18"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4ZDyZEOf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xk74fii50w0w2v3s4cpg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4ZDyZEOf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xk74fii50w0w2v3s4cpg.png" alt="Screenshot 2020-12-22 at 17.29.49"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Execution &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Now that we have created the Dockerfile, to build and image&lt;/p&gt;
&lt;h4&gt;
  
  
  docker build -t {image name} .
&lt;/h4&gt;

&lt;p&gt;This will create an image for us to execute.&lt;/p&gt;

&lt;p&gt;Once we create the image, we should run the image to create a container. We can run the image by using the below command&lt;/p&gt;
&lt;h4&gt;
  
  
  docker run -it {image name}
&lt;/h4&gt;

&lt;p&gt;This will trigger the scripts right away and once the execution is complete, the container will be exited.&lt;/p&gt;

&lt;p&gt;This is how we use docker to run automation scripts created using webdriverio.&lt;/p&gt;
&lt;h3&gt;
  
  
  Mounting Volumes &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Now comes the interesting topic, how can we ensure we don't create multiple images for every change that we make yet test all those changes in docker. This is where Volumes comes in.&lt;/p&gt;

&lt;p&gt;Docker Volumes is a means of sharing a directory from the local machine with the container. So how do we achieve this?&lt;br&gt;
It's quite simple actually. You don't have to do anything while creating the image, only when you run the image add -v tag as shown below&lt;/p&gt;
&lt;h4&gt;
  
  
  docker run -v : {image name}
&lt;/h4&gt;

&lt;p&gt;That's it!&lt;/p&gt;

&lt;p&gt;But the question comes up again what do you want to share as sharing the node modules again will create a problem. So while sharing the directory ensure you only share the files you want to. For example, if you have all your spec files inside the folder "tests" then the below command will only share the files under this directory.&lt;/p&gt;
&lt;h4&gt;
  
  
  docker run -v /tests/:/tests/ {image name}
&lt;/h4&gt;

&lt;p&gt;Then comes the question of priority, one can assume that local files always takes precedence over the files in an image when we mount the volumes. Hurray!&lt;/p&gt;

&lt;p&gt;Make as many changes as you want and run all of those changes in a docker container. &lt;/p&gt;

&lt;p&gt;Please refer to the video above in case you need a demo. &lt;/p&gt;

&lt;p&gt;Clone the repo from&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vJ70wriM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-ba8488d21cd8ee1fee097b8410db9deaa41d0ca30b004c0c63de0a479114156f.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/17thSep"&gt;
        17thSep
      &lt;/a&gt; / &lt;a href="https://github.com/17thSep/WDIO6_Docker_Custom_Image"&gt;
        WDIO6_Docker_Custom_Image
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      In this repository i have experimented with creating your own docker image of the automation scripts.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
WDIO6_Docker_Custom_Image&lt;/h1&gt;
&lt;p&gt;In this repository i have experimented with creating your own docker image of the automation scripts to run it in docker&lt;/p&gt;
&lt;p&gt;You can watch the process as a video in the below link
&lt;a href="https://youtu.be/Yjg476fg1l0" rel="nofollow"&gt;https://youtu.be/Yjg476fg1l0&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/17thSep/WDIO6_Docker_Custom_Image"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;Below are some useful links to ponder upon.&lt;/p&gt;

&lt;p&gt;buildpack-deps Image&lt;br&gt;
&lt;a href="https://github.com/docker-library/buildpack-deps"&gt;https://github.com/docker-library/buildpack-deps&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Node Image&lt;br&gt;
&lt;a href="https://github.com/nodejs/docker-node/blob/master/12/buster/Dockerfile"&gt;https://github.com/nodejs/docker-node/blob/master/12/buster/Dockerfile&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have any questions please add a comment, if you find this useful make sure you let me know. it is the biggest source of motivation!&lt;/p&gt;

&lt;p&gt;Cheers!&lt;br&gt;
Ap.&lt;/p&gt;

</description>
      <category>docker</category>
      <category>webdriverio</category>
      <category>dockerfile</category>
      <category>containers</category>
    </item>
    <item>
      <title>WebdriverIO 6.0 + Docker + Selenium Hub 4.0</title>
      <dc:creator>17thSep</dc:creator>
      <pubDate>Sat, 12 Dec 2020 22:00:23 +0000</pubDate>
      <link>https://dev.to/17thsep1/webdriverio-6-0-docker-selenium-hub-4-0-l4m</link>
      <guid>https://dev.to/17thsep1/webdriverio-6-0-docker-selenium-hub-4-0-l4m</guid>
      <description>&lt;p&gt;Ok, let's begin. My main intention is to play around with Docker containers and see if there are any benefits for Automation testers.&lt;/p&gt;

&lt;p&gt;Given that the world is moving from a VM world to a container world it's kinda obvious that one has to move towards containers but it's not necessary for all.&lt;/p&gt;

&lt;p&gt;In this article, I am going to explain how one can configure WebdriverIO to run the test scripts in a docker container using Selenium-hub.&lt;/p&gt;

&lt;p&gt;What do we need&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An automation script &lt;/li&gt;
&lt;li&gt;Docker&lt;/li&gt;
&lt;li&gt;Official docker images from {See below for github details}

&lt;ul&gt;
&lt;li&gt;Selenium Hub&lt;/li&gt;
&lt;li&gt;Nodes of the browser {chrome, firefox, opera}&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;VNC Server/viewer (Optional)&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vJ70wriM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-ba8488d21cd8ee1fee097b8410db9deaa41d0ca30b004c0c63de0a479114156f.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/SeleniumHQ"&gt;
        SeleniumHQ
      &lt;/a&gt; / &lt;a href="https://github.com/SeleniumHQ/docker-selenium"&gt;
        docker-selenium
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Docker images for the Selenium Grid Server
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
Docker images for the Selenium Grid Server&lt;/h1&gt;
&lt;p&gt;The project is made possible by volunteer contributors who have put in thousands of hours of their own time
and made the source code freely available under the &lt;a href="https://raw.githubusercontent.com/SeleniumHQ/docker-selenium/trunk/LICENSE.md"&gt;Apache License 2.0&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/SeleniumHQ/docker-selenium/workflows/Build%20&amp;amp;%20test/badge.svg?branch=trunk"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--B0tuJ1BK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/SeleniumHQ/docker-selenium/workflows/Build%2520%26%2520test/badge.svg%3Fbranch%3Dtrunk" alt="Build &amp;amp; test"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://github.com/SeleniumHQ/docker-selenium/workflows/Deploys/badge.svg"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jVirzEvG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/SeleniumHQ/docker-selenium/workflows/Deploys/badge.svg" alt="Deployments"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
👉 Status: Grid 4 is under development and on a &lt;a href="https://en.wikipedia.org/wiki/Software_release_life_cycle#Beta" rel="nofollow"&gt;Beta stage&lt;/a&gt;
&lt;/h1&gt;
&lt;p&gt;We are doing prereleases on a regular basis to get early feedback. This means that all other Selenium components
can be currently at a different alpha version (e.g. bindings on Beta 1, and Docker images on prerelease Beta 2).&lt;/p&gt;
&lt;p&gt;Docker images for Grid 4 come with a handful of tags to simplify its usage, have a look at them in one of
our &lt;a href="https://github.com/SeleniumHQ/docker-selenium/releases/tag/4.0.0-beta-1-20210215"&gt;prereleases&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To get notifications of new prereleases, add yourself as a watcher of "Releases only".&lt;/p&gt;
&lt;p&gt;Doubts or questions? Please get in touch through the different communication channels available in the &lt;strong&gt;Community&lt;/strong&gt; section.&lt;/p&gt;
&lt;p&gt;Looking for Grid 3…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/SeleniumHQ/docker-selenium"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Note:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;There is no official node for IE.&lt;/li&gt;
&lt;li&gt;Docker cannot be installed directly on a few versions of windows.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can watch this entire article in a video in the below link as well.&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/NDt4alzH5E0"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 1:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Ensure you have the automation script working on your local machine. In case you don't have it ready you can download this from this repository.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vJ70wriM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-ba8488d21cd8ee1fee097b8410db9deaa41d0ca30b004c0c63de0a479114156f.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/17thSep"&gt;
        17thSep
      &lt;/a&gt; / &lt;a href="https://github.com/17thSep/WDIO6_Docker"&gt;
        WDIO6_Docker
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
WDIO6_Docker (GRID + NODE)&lt;/h1&gt;
&lt;p&gt;This is a sample script to run WebdriverIO Automation scripts in docker.
I have added the compose file and the package.json
You can clone this repository and do an npm install to get going.&lt;/p&gt;
&lt;p&gt;Pre-requirements&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Docker client should be installed on your machine&lt;/li&gt;
&lt;li&gt;node.js v12.16.1 or greater&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can watch a video of how we can use docker to run automation scripts in the below link.
&lt;a href="https://youtu.be/NDt4alzH5E0" rel="nofollow"&gt;https://youtu.be/NDt4alzH5E0&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/17thSep/WDIO6_Docker"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;Points to consider: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You must have Node.js version v12.16.1 or higher as mentioned on the official site for WDIO v6&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ensure the Browser and chrome driver are compatible.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 2:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Changes to the configuration file&lt;/p&gt;

&lt;p&gt;In your WebdriverIO config file, you have to make 2 changes&lt;/p&gt;

&lt;p&gt;Add the location where you are planning to run your Selenium hub. Here I am running on the default port 4444 as shown in the screenshot.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--H3Nc6WlW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/tn4axvyjevuw75h92y9s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--H3Nc6WlW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/tn4axvyjevuw75h92y9s.png" alt="Screenshot 2020-12-07 at 22.11.03"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Specify the runner to be docker.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tfm37qu3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/qtpx3q6h6dr01auz2tka.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tfm37qu3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/qtpx3q6h6dr01auz2tka.png" alt="Screenshot 2020-12-07 at 22.07.42"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's the configuration part.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Points to consider:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you have cloned the repository from the above git link, I have already made that change.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 3:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Create the containers for Selenium Hub and Node&lt;/p&gt;

&lt;h4&gt;
  
  
  Selenium Hub:
&lt;/h4&gt;

&lt;p&gt;You can consider this to be the brains of the execution.&lt;/p&gt;

&lt;p&gt;Selenium Hub will control which node should run which spec file/feature file and will distribute the unexecuted files based on the availability of the nodes.&lt;/p&gt;

&lt;h4&gt;
  
  
  Chrome Node
&lt;/h4&gt;

&lt;p&gt;This is a simple Linux system with all that we need to run out Automation scripts i.e. browsers&lt;/p&gt;

&lt;p&gt;You can do so in 2 ways &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Option 1:&lt;/strong&gt; &lt;br&gt;
Manually run the commands on your terminal and kind of establish the communication between the hub and the nodes&lt;/p&gt;

&lt;p&gt;Please refer &lt;strong&gt;Docker networking&lt;/strong&gt; section in the git hub link provided above.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Option 2:(Recommended approach)&lt;/strong&gt;&lt;br&gt;
Simply just create a docker-compose file and save it as docker-compose.yml in the same location where you have your config file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FpQAAEib--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8i873awpddps4vkpq1xd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FpQAAEib--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8i873awpddps4vkpq1xd.png" alt="Screenshot 2020-12-07 at 22.16.19"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to know more about the Docker compose file and what you should know please refer to step 7.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 4:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Running your docker container. This can be done again in 2 ways based on what you have chosen in step 3. &lt;/p&gt;

&lt;p&gt;If you have chosen Option 1, then follow the commands provided in the description provided in the same URL. This is definitely a viable option if you just want to experiment but this has its limitation and inconveniences&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You will have to run the same command every time you want to bring the setup&lt;/li&gt;
&lt;li&gt;Scaling could be not as simple as it should be.
And many more. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's why I would always recommend Option 2 which is through docker-compose. If you have chosen this option, All you have to do is type one command after going to the location where you have placed the docker-compose.yml file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;docker-compose up -d&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In case you have the filename as something else e.g. abcd.yml then &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;docker-compose -f abcd.yml up -d&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Note: -d here is to run the container in a detached mode.&lt;/p&gt;

&lt;p&gt;To verify if you have the nodes and selenium hub up and running you can verify by going to the URL &lt;a href="http://localhost:4444/ui/index.html#/console"&gt;Click here&lt;/a&gt; from the machine where you are running you selenium hub&lt;/p&gt;

&lt;p&gt;If the setup is successful it should like this&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3xqCjdIZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/nq7lc8uba27ha05nz2qm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3xqCjdIZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/nq7lc8uba27ha05nz2qm.png" alt="Screenshot 2020-12-08 at 07.18.09"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 5:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Running you automation script&lt;/p&gt;

&lt;p&gt;Now, all the setup is done. You can see 3 chrome nodes in the Selenium hub and once you trigger the scripts you can see the execution will begin in the containers.&lt;/p&gt;

&lt;p&gt;If you want to see how the scripts are triggered visually, you can do so by setting up your VNC server and VNC viewer.&lt;br&gt;
The command below shows all the containers that are running and their IP address and the ports.&lt;/p&gt;

&lt;p&gt;So to see a specific container take up the port and enter in VNC viewer and then it will ask for a password.&lt;br&gt;
The password is &lt;strong&gt;secret&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nEm4vhqL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/tlt8wpo7osbonezktjg6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nEm4vhqL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/tlt8wpo7osbonezktjg6.png" alt="Screenshot 2020-12-07 at 22.40.30"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 6:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Analyzing your Results&lt;/p&gt;

&lt;p&gt;Depending upon whether you want to get as an HTML file or as a JSON file you can choose from the list that WebdriverIO is providing&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 7:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Docker compose&lt;/p&gt;

&lt;p&gt;There are a lot of things that one can learn about docker-compose but I will limit this to what we should from an automation perspective.&lt;/p&gt;

&lt;p&gt;We need 2 main things&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Flexibility to scale the number of nodes so parallel execution can be faster&lt;/li&gt;
&lt;li&gt;The order in which the images should be &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When we scale the nodes it's kind of imminent that we don't use the same port number more than once. To avoid that, we have 2 options,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;we can leave it to docker for the ports from the local machine and specify the ports inside the container. (Recommended)&lt;/li&gt;
&lt;li&gt;we can specify a range of ports that we want to allocate for the nodes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If we want to spend less time troubleshooting different ports that are currently in use, I would strongly suggest to leave it to docker.&lt;/p&gt;

&lt;p&gt;However, in the second part where we specify the port inside the docker container that's what the official image has but you change it or leave it as it is.&lt;/p&gt;

&lt;p&gt;I will stop here, hope you found this useful!&lt;/p&gt;

&lt;p&gt;Thanks &lt;/p&gt;

</description>
      <category>webdriverio</category>
      <category>docker</category>
      <category>selenium</category>
      <category>automation</category>
    </item>
  </channel>
</rss>
