Monday, January 27, 2020

Software Testing Automation Guide

 get methods in Selenium Webdriver


Below are the list of get methods that can be use with driver.

Get()-

This command is used to send certain string in Web browser address bar. It will take single sting as parameter.

driver.get(http://google.com) or http:\google.com


Note:- In java, w can use use double forward(“//”)  OR can use single backward(“\”) while writing any url as string.


getClass()-

The command is used to retrieve the Class object which represents the runtime class of this object.

driver.getClass();


getCurrentUrl()-

The command is used to retrieve the URL of the webpage which is currently active.

driver.getCurrentUrl();


getPageSource()-

The command is used to retrieve the page source of the webpage which is currently active.

driver. getPageSource();


getTitle()-

The command is used to retrieve the title of the webpage which is currently active.

driver. getTitle();


getWindowHandle()-

The command is used when you have multiple window and you have to working with parent window.

driver. getWindowHandle();


getWindowHandles()-

This commend is used when user has more than 1 window. With this command user can get the list of available window and interact with each.

driver.getWindowHandles();


Close()-

This Command is use to close the active window.

driver.close();


Quit()-

This command is use to close all opened windows.

driver.quite();


Different between close and quite- Close command will close only active window, however Quit command will close all tabs and open windows.


How to pass password in url.

http://username:password@example.com


Software Testing Automation Guide

  get methods in Selenium Webdriver Below are the list of get methods that can be use with driver. Get()- This com...