Google+

290. manage( ).window( ).maximize( ) - to maximize the Browser window







'manage( ).window( ).maximize( )' predefined method of Selenium 'WebDriver' Class is used to maximize the test browser window in which the specified URL has been opened in our earlier post.

Example:  

_driver.manage( ).window( ).maximize( );

Lets Implement This:

1. Open the URL using the Selenium 'WebDriver' command get( ) as explained in our previous Post#14
2. Type _driver object of Selenium 'WebDriver' Class and press dot '.' key on your keyboard as shown below:



3. Type 'manage' text followed by dot as shown below to filter the displayed Selenium 'WebDriver' predefined methods and select the 'manage( )' method as shown below:



4. Ensure that the selected method got added to the Code as shown below:



5. After manage( ) method, press dot '.' key on your keyboard as shown below:



6. Type 'window' text followed by dot as shown below to filter the displayed Selenium 'WebDriver' predefined methods and select the 'window( )' method as shown below:



7. Ensure that the selected method got added to the Code as shown below:



8. After window( ) method, press dot '.' key on your keyboard as shown below:



9.Type 'maximize' text followed by dot as shown below to filter the displayed Selenium 'WebDriver' predefined methods and select the 'window( )' method as shown below:



10. Ensure that the selected method got added to the Code as shown below:



11. Now end the statement with a semicolon and save the Automation test as shown below:



12. Run the Automation Test using JUnit as shown below:



13. Observe that the Browser window got maximized as shown in  the below video:

Click Here to watch the video.


Download this Project:

Click here to download the Project explained in this post and import into Eclipse IDE on your machine.



Please comment below to feedback or ask questions.

manage( ).window( ).setSize( ) -  to resize the Browser window will be explained in the next post.


No comments: