- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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 and minimize browsers in Selenium with python?
We can maximize and minimize the browser while we are testing an application in Selenium.
For maximizing the browser, maximize() method is to be used.
For minimizing the browser, minimize() method is to be used.
Both these methods can be used simultaneously in the same program.
Example
Code Implementation
from selenium import webdriver #browser exposes an executable file #Through Selenium test we will invoke the executable file which will then #invoke actual browser driver = webdriver.Firefox(executable_path="C:\geckodriver.exe") # to maximize the browser window driver.maximize_window() #get method to launch the URL driver.get("https://www.tutorialspoint.com/index.htm") #to refresh the browser driver.refresh() # to minimize the browser window driver.minimize_window() #to close the browser driver.close()
- Related Articles
- Removing minimize/maximize buttons in Tkinter
- Maximize WebDriver (Selenium 2) in Python.
- How to maximize the browser in Selenium?
- How can we minimize/maximize a JFrame programmatically in Java?
- What are the common driver methods that can be applied to browsers in Selenium with python?
- How to click on across browsers using Selenium Webdriver?
- Browsers and Platforms supported by Selenium Tools.
- How to maximize the browser window in Selenium WebDriver using C#?
- How to work with cookies in Selenium with python?
- How to use Selenium with Python?
- How to handle frames in Selenium with python?
- How to run Selenium tests in multiple browsers one after another from C# NUnit?
- How to perform drag and drop operation in Selenium with python?
- How to upload file with selenium (Python)?
- How to handle child windows in Selenium with python?

Advertisements