Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Selenium Essentials

You're reading from   Selenium Essentials Get to grips with automated web testing with the amazing power of Selenium WebDriver

Arrow left icon
Product type Paperback
Published in Mar 2015
Publisher
ISBN-13 9781784394332
Length 194 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Prashanth Sams Prashanth Sams
Author Profile Icon Prashanth Sams
Prashanth Sams
Arrow right icon
View More author details
Toc

Window functions


The browser window is a source key for web automation tests. A web page should cover W3C standards and meet responsive design needs. In general, the test status (pass/fail) varies with the varying size of browser windows for a buggy site built without proper responsive design and W3C standards. Selenium WebDriver handles browser window tasks, such as resizing the window, locating the window, and switching windows with its extensive API support without any JavaScript injections from outside. Let's discuss Selenium window functions:

  • The maximize() method lets you maximize the current browser window size. This function directly responds to the browser window; however, the user needs the java.awt.Robot library for Java bindings to work along with the screen resolutions. The following is the syntax of this function:

    driver.manage().window().maximize();

    Maximizing the browser window gives a better view of test execution. By default, the browser window is in normal mode and not maximized...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime