Software testing tutorials and automation
A blog on Selenium tutorial, Selenium webdriver tutorial, Selenium IDE tutorial, Appium Tutorial, Selenium Grid Tutorial, Jmeter Tutorial.
A Beginner’s Guide to Selenium WebDriver: Automate Your Testing with Ease
Getsize In Selenium
Selenium getSize() method
- getSize() method in selenium is part of WebDriver.Window interface.
- It is used when you want to get current working window dimensions.
- It will return height and width of current working browser window.
- Syntax : driver.manage().window().getSize();
Selenium Set Window Size
Set browser window size in selenium
Selenium Window Full Screen
Full Screen Window In Selenium
Selenium fullscreen() method is used to full screen the browser window. It will perform browser full screen action same as real user full screen the browser window. May be sometimes you need full screen window in your selenium tests at that time this method will be very useful for you.
- fullscreen() method is part of WebDriver.Window interface.
- It's return type is void so it returns nothing.
- It will full screen the browser window.
- Syntax : driver.manage().window().fullscreen();
Selenium Minimize Window Of Browser
Minimize window in selenium
Selenium 4 has built in method to minimize the browser window. It is less used method in selenium but still you can use it if you want to minimize window in between selenium test. minimize() method will perform browser minimize user action. You can run your selenium tests in minimized browser mode and you can perform your other tasks beside.
- minimize() method is part of WebDriver.Window method.
- This method will return nothing because it's return type is void.
- It will minimize the current working window if it is not already minimized.
- It is helpful when your are performing manual testing or any other work as your selenium tests will be executed in minimized mode.
- Syntax : driver.manage().window().maximize();
Selenium Maximize Window Of Browser
Maximize window in selenium
Selenium get url using getCurrentUrl()
Get url in selenium using getCurrentUrl() Method
- getCurrentUrl() method is part of WebDriver interface which extends SearchContext interface.
- It will fetch the url from current open page in browser.
- It will return rul as a string.
- Syntax to use getCurrentUrl() : driver.getCurrentUrl().
Selenium close browser
Close browser in selenium using close() method
To close browser in selenium, You can use close() method. It is used to close current open window on which selenium test is being executed.
- close() method is part of WebDriver interface which extends SearchContext interface.
- close() method in selenium will close only current selected window.
- If multiple browser windows are open in selenium test then all windows will be not closed using close() method.
- Syntax for using close() method is driver.close();