title: Selenium browser window size
body: <p>I'm new at using selenium. I have downloaded the Selenium Standalone Server and successfully got it running by typing</p>
  
  <pre><code>java -jar selenium-server-standalone-2.14.0.jar
  </code></pre>
  
  <p>into the command line.</p>
  
  <p>After running</p>
  
  <pre><code> phpunit.bat
  </code></pre>
  
  <p>from the command line, all of my tests will pass as expected except for one unless I manually maximize the Firefox browser window that automatically is opened during the testing process.</p>
  
  <p>While the tests are running, when the Firefox browser window opens, if I don't maximize that window while my login test is running, then that test will fail and somehow redirect to a unexpected page on my website. If I do maximize the window before the test completes, the "login" button gets clicked as expected, the correct page gets loaded, and the test passes.</p>
  
  <p>Thus, I'm wondering if there is a way to change the settings somewhere so that the Firefox browser would just open maximized while the tests are running?</p>
  
  <p>I've Googled around and discovered some various code snippets that might help, but I'm not sure where the PHP version of this code is or where to put some similar code for the version of Selenium I'm using (the Selenium Standalone Server):</p>
  
  <pre><code># repositioning and resizing browser window:
  driver.manage.window.move_to(300, 400)
  driver.manage.window.resize_to(500, 800)
  driver.manage.window.maximize
  </code></pre>
  
  <p>or this which is C#, but I need PHP and don't know where to find the right code or where to put it:</p>
  
  <pre><code>driver.Manage().Window.Maximize();   
  </code></pre>
  
  <p>Here is the code for the login Selenium test in question (using Laracasts/Integrated) from my tests/SeleniumTest.php file:</p>
  
  <pre><code>&lt;?php
  
  use Laracasts\Integrated\Extensions\Selenium;
  use Laracasts\Integrated\Services\Laravel\Application as Laravel;
  
  class SeleniumTest extends Selenium
  {
      use Laravel;
      /**
       * Tests to see if the login page loads
       */
      public function testToSeeIfLoginLoads()
      {
          $this-&gt;visit('/login')
              -&gt;see('Login')-&gt;see('Email Address')-&gt;see('Password')
              -&gt;type('myemail@email.com', 'email')-&gt;type('mypassword', 'password')
              -&gt;waitForElement('log_in')
             -&gt;click('log_in')
              -&gt;waitForElement('table_summary')
              -&gt;see('Complete Course Summary');
      }
  </code></pre>