

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to maximize the browser in Selenium?
We can maximize the browser in Selenium with the help of method maximize().
The present active window becomes maximized with this method.
Code implementation.
Example
import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import java.util.concurrent.TimeUnit; public class BrowserMax { public static void main(String[] args) { System.setProperty("webdriver.chrome.driver", "C:\Users\ghs6kor\Desktop\Java\chromedriver.exe"); WebDriver driver = new ChromeDriver(); String url = "https://www.tutorialspoint.com/index.htm"; driver.get(url); // maximizing browser with maximize() driver.manage().window().maximize(); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); driver.findElement(By.partialLinkText("Coding")).click(); driver.close(); } }
- Related Questions & Answers
- How to maximize the browser window in Selenium WebDriver using C#?
- How to maximize or minimize a browser window using Selenium webdriver with Python?
- How to perform browser navigations in Selenium?
- How does selenium webdriver upload files to the browser?
- How to invoke the Chrome browser in Selenium with python?
- How to invoke the Firefox browser in Selenium with python?
- How to invoke the IE browser in Selenium with python?
- How to launch Chrome Browser via Selenium?
- How to start selenium browser with proxy?
- How to set the size of the browser window in Selenium?
- How does selenium interact with the Web browser?
- Maximize WebDriver (Selenium 2) in Python.
- Python selenium browser driver.back().
- Selenium testing without browser.
- How to maximize and minimize browsers in Selenium with python?
Advertisements