How to maximize the browser window in Selenium WebDriver (Selenium 2) using C#?
There's an outstanding issue to add this functionality to WebDriver, which can be tracked here: http://code.google.com/p/selenium/issues/detail?id=174
A workaround would be to use the JavascriptExector
as follows:
public void resizeTest() {
driver.Navigate().GoToUrl("http://www.example.com/");
((IJavaScriptExecutor)driver).ExecuteScript("window.resizeTo(1024, 768);");
}
Open browser window in full screen using Selenium WebDriver with C#
driver.Manage().Window.Maximize();
isn't that simple?
Maximize browser window for Firefox with Selenium WebDriver C#
For Firefox use -
driver.Manage().Window.Maximize();
You can check this link for more details - How do I maximize the browser window in Selenium WebDriver (Selenium 2) using C#?
How to get browser window front while running the test using selenium C#?
If while running script any new opened window is not active then you can use
getDriver().switchTo().window("your window name");
Related Topics
Digital Signature in C# Without Using Bouncycastle
How to Implement Permission Based Access Control with ASP.NET Core
Why Are There System.*.* Dlls in My Bin Release Directory
Define a Generic That Implements the + Operator
System.Badimageformatexception: Reference Assemblies Should Not Be Loaded for Execution
ASP.NET Gridview: How to Edit and Delete Data Records
How to Play a Sound in an ASP.NET Web Page
Referenced Project Gets "Lost" at Compile Time
Wpf/C#: Where Should I Be Saving User Preferences Files
Ftp Directory Partial Listing with Wildcards
How to Access Session in a Webmethod
How to Prevent an Exception in a Background Thread from Terminating an Application
How and Why Do I Set Up a C# Build MAChine
How to Use Font Awesome Icons in Project as an Icon of Imagebutton
Sequence Contains No Matching Element
How to Add Code Outside the Scope of Main When Using C# 9 Top Level Statements