Using getwindowhandle() and getWindowHandles() methods in Selenium WebDriver

getwindowhandle() and getWindowHandles() in selenium are methods to get window handles in selenium. getwindowhandle() is useful to get handle of current selected window in selenium while getWindowHandles() will return handles of all open windows or tabs. Both these methods getwindowhandle() and getWindowHandles() in selenium are useful when you are working with multiple windows and you need … Read more

Difference between close() and quit() in selenium WebDriver

Many new learners are initially confused about when to use close() and when to use quit() method for selenium close browser. Selenium close() method will close the current instance of the webdriver object reference. In simple word, Selenium close will close current window or tab on which your test is currently running. Selenium driver quit() methods will … Read more

What is the usage of getPageSource() method in Selenium WebDriver

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 … Read more

How to use findElement() method in Selenium WebDriver

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 … Read more