title: Opening chrome using docker to run selenium automation test
body: <p>while running selenium tests locally, it automatically opens up the chrome browser to perform tasks. However, while running the same command from docker does not and the tests fails with below error.</p>
  
  <p><strong>Unknown error: cannnot focus element</strong></p>
  
  <p><strong>Error: An unknown server-side error occurred while processing the command.</strong></p>
  
  <pre><code>kam-MBP: kl$ docker build -t dockerfinal .
  Sending build context to Docker daemon  787.3MB
  Step 1/3 : FROM dockerinit
   ---&gt; 4d6fdb65d879
  Step 2/3 : USER root
  
  ---&gt; Using cache
   ---&gt; 5fab69855211
  
  Step 3/3 : RUN ./node_modules/.bin/wdio
   ---&gt; Running in f55f142eabf3
  ------------------------------------------------------------------
  
  [chrome #0-0] Session ID: 819c77057d6a7e274c8fbfd36858e3d9
  [chrome #0-0] Spec: /tinderbox2_frontend/e2e/accproset.test.js
  [chrome #0-0] Running: chrome
  
  [chrome #0-0]
  [chrome #0-0] accountprojectsetting
  [chrome #0-0]   1) "before each" hook for "should be able to do setting in account and project"
  [chrome #0-0]
  [chrome #0-0]
  [chrome #0-0] **1 failing (30s)**
  
  [chrome #0-0]
  [chrome #0-0] 1) accountprojectsetting "before each" hook for "should be able to do setting in account and project":
  [chrome #0-0] **unknown error: cannot focus element**
  [chrome #0-0] Error: An unknown server-side error occurred while processing the command.
  [chrome #0-0]     at elementIdValue("0.17283645604924724-1", "testG1BDCgRtwowtEBp@moxion.rocks") - setValue.js:46:80
  </code></pre>
  
  <p>My <strong>dockerinit</strong> image docker file is below:</p>
  
  <pre><code># setting base image
  FROM selenium/standalone-chrome
  
  USER root
  
  # Set the working directory to /tin_fe
  WORKDIR /tin_fe
  
  #Access to the project within docker container - Bundle app source
  COPY . /tin_fe
  
  # Install Node.js
  RUN apt-get update
  RUN apt-get install --yes curl
  
  #configuring nodeSource repository to get enough version of nodejs
  RUN curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
  RUN apt-get install -y nodejs
  
  #configuring debian package repository 
  RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
  RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
  
  #installing yarn 
  RUN apt-get update &amp;&amp; apt-get install -y yarn 
  
  #installing binary git package
  RUN apt-get update
  RUN apt-get install -y git
  
  #running yarn
  RUN yarn  
  </code></pre>