- 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 open a browser window in full screen using Selenium WebDriver with C#?
We can open a browser window in full screen using Selenium webdriver in C# by using the method Maximize. This method has to be applied on the webdriver object.
Syntax
driver.Manage().Window.Maximize();
Example
using NUnit.Framework; using OpenQA.Selenium; using OpenQA.Selenium.Firefox; using System; namespace NUnitTestProject1{ public class Tests{ String url = "https://www.google.com/"; IWebDriver driver; [SetUp] public void Setup(){ //object of FirefoxDriver driver = new FirefoxDriver(); } [Test] public void Test1(){ //URL launch driver.Navigate().GoToUrl(url); //browser maximize driver.Manage().Window.Maximize(); Console.WriteLine("Browser Maximized"); } [TearDown] public void closeBrowser(){ driver.Quit(); } } }
Output
Advertisements
To Continue Learning Please Login
Login with Google