title: Firefox doesn't wait for a page load Webdriverio
body: <p>I am trying to run my test using <code>Selenium</code> and just encountered the problem. I have my test written for the <code>Chrome</code> browser. Now I have been trying to run the same tests in the <code>Firefox</code> browser, but they failed.</p>
  
  <p>I've started to investigate the problem and found out that <code>Firefox</code> doesn't wait until page is fully loaded. Chrome works perfectly.</p>
  
  <p>I am running <code>Selenium</code> in docker containers. </p>
  
  <p>Here is my script</p>
  
  <pre><code>storeSearch(info) {
          let that = this;
          return new Promise(function (resolve, reject) {
              browserClient.init()
                  .url("http://somewhere.com")
                  .selectByVisibleText("#store","Tech")
                  // Redirect to a new page
                  .setValue("input[name='search']", info.searchCriteria)
                  .selectByValue(".featured", 'MacBook')
                  .click("button[name='info']")
                  .element('.popup')
                  .then(function (element) {
                      if (element.state === 'success') {
  
                      }
                  });
          });
      }
  </code></pre>
  
  <p>It doesn't try even to select a store type from the select <code>.selectByVisibleText("#store","Tech")</code> and just throws an exception.</p>
  
  <blockquote>
    <p>"An element could not be located on the page using the given search
    parameters (\"input[name='search']\").",</p>
  </blockquote>
  
  <p>I have tried to add <code>timeouts</code> but it doesn't work as well and gives me an error.</p>
  
  <pre><code>  browserClient.init()
                      .url("http://somewhere.com")
                      .timeouts('pageLoad', 100000)
                      .selectByVisibleText("#store","Tech")
  </code></pre>
  
  <p>The following error is thrown.</p>
  
  <blockquote>
    <p>"Unknown wait type: pageLoad\nBuild info: version: '3.4.0', revision:
    'unknown', time: 'unknown'\nSystem info: host: 'ef7581676ebb', ip:
    '172.17.0.3', os.name: 'Linux', os.arch: 'amd64', os.version:
    '4.9.27-moby', java.version: '1.8.0_121'\nDriver info: driver.version:
    unknown</p>
  </blockquote>
  
  <p>I have been trying to solve this problem for two days, but no luck so far.</p>
  
  <p>Could someone help, maybe you have some ideas what can cause the problem ?</p>
  
  <p>Thanks.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <pre><code> .url("http://somewhere.com")
                  .pause(2000)
                  .selectByVisibleText("#store","Tech")
  </code></pre>
  
  <p>If I put some <code>pause</code> statements it works, but this is really bad and not what I expect from this framework. Chrome works perfectly. It waits until loading bar is fully loaded and only then performs actions.</p>
  
  <p><strong>The problem is in geckodriver I guess, I have tested it the same flow in Python, Java and the behavior is exactly the same.</strong></p>