manage() method is very basic and we are using it very frequently in selenium WebDriver tests. You can use it to manage size and positions of browser window during your test. You can use it to add or delete cookie, get cookie, timeouts, waits and there are many other usages as well but here we will discuss about how to maximize browser or set it to full screen mode.

navigate() method is very frequently used method in selenium webdriver. Using this method, driver can navigate back, forward, refresh browser and navigate to specific URL. navigate() is very simple method and we can use it verify quickly in our selenium webdriver tests. Lets see how we can use navigate() method in selenium webdriver.

We can use switchTo() method when you want to switch between multiple browser windows or multiple frames on page. Earlier we had seen how to switch between two windows using getWindowHandles() and switchTo() methods. Here we will see how to switch between iFrames on page using switchTo() method by index of iFrame.

getwindowhandle() and getWindowHandles() are methods to get handle of window. getwindowhandle() is useful to get handle of current selected window or tab while getWindowHandles() will return handles of all open windows or tabs. Both these methods are useful when you are working with multiple windows and you need to switch from one window to another window.

Many new learners are initially confused about when to use close() and when to use quit() method in Selenium WebDriver. close() method will close the current instance of the webdriver object reference. In simple word, It will close current window or tab on which your test is currently running. quit() methods will dispose webdriver object so it is also known as dispose method. In simple word, quit() methods will close all open browser tabs or windows.

As name suggest, getPageSource() method is useful to get source of last loaded web page. Please note here, If web page is modified(by javascript) after loading of page then getPageSource() may return page source of before modified page. You can get whole page source using this method and then you can use it as per your requirement.

Let's see how getPageSource() method can be used in selenium test.

Selenium Webdriver's findElement() method is useful to locate WebElement for page. It is one of the mostly used method in selenium webdriver. It uses By object as parameter can can use it with various element locating strategies like ID, Name, Linktext, Partial Linktext, Tag Name, Class Name, DOM Locator, CSS Selector and Xpath. findElement() will return first matching webelement from page.

findElements method is different than the findElement method in selenium webdriver. findElements method is useful to find all elements from page using given element locator strategies.You can locate all specific elements from page using class name, css selector, id, name, link text, partial link text, tag name or xpath. findElements will return list of web elements using given locator strategy and then you can iterate through list and perform action. Lets see how it works.