You are on page 1of 3

WEB DRIVER CODING LEVEL ARCHITECTURE

---> Find
SearchContext (I)
---> Find

WebDriver (I) --->Browser

RemoteWebDriver
(C)

ChromeDriver (C) Fire foxDriver (C) OperaDriver (C) E

WAYS TO LAUNCH THE BROWSER

1. ChromeDriver driver = new chromedriver


a. Here we can execute all the scripting in one browser only.
b. In future if we want to perform cross browser execution then this approach is not
recommended.
2. RemoteWebDriver = new chromedriver (Upcasting)
a. Here we can achieve cross browser execution by using upcasting.
b. But this approach is recommended for selenium grid that is execute the script in
multiple system
3. WebDriver driver.new chromedriver (); (Upcasting)
a. This is the most popular and recommended approach tp launch the browser
b. Here we can achieve cross browser execution by using upcasting.
4. SearchContext driver = new chromedriver () (Upcasting)
a. Here we can launch the browser but not possible to open any application by using
this approach
ASSIGNMENT-LIST ALL THE WEBDRIVER SHOWING IN THE PROGRAM

close()

findElement(By by)

findElements(By by)

get(java.lang.String url)

getCurrentUrl()

getPageSource()

getTitle()

getWindowHandle()

getWindowHandles()

manage()

navigate()

quit()

switchTo()

ASSIGNMENT-LIST ALL THE METHODS FROM WEBELEMENT INTERFACE (JUST TYPE WEB.)

WEB ELEMENT INTERFACE METHODS

 Submit (): void


o This method will fulfil search requirement.
o This method will not work for login scenarios.
o Program (flipkartsubmit-eclipse)
 Clear (): void
o This method is used to clear the data present in the text box.
o This method mainly we will use for edit functionality.
o Program (flipkartclear-eclipse)
 getLocation():point
o This method is used to fetch the location of the particular web element.
o The return type of this method is point class.
 getSize():dimension
o this method is used to fetch the size of the WebElement.
o The return type of this method is dimension class.
 getRect():rectangle
o this method is used to fetch the x and y coordinates or width and hight of a
particular web element separately.
o The return type of this method is rectangle class.
 getAttribute():String
o this method will return particular attribute value present in the WebElement.
 HOW TO FETCH THE VALUE PRESENT IN ATEXT BOX?
o Whenever we are passing a value in a text box by default, it will get stored in value
attribute.

username

password

 HOW TO HANDLE H-OVER MESSAGE?


o By default the h-over message will get stored in “title” attribute.
 getTagName():String
o This method is used to fetch the tag name of a particular WebElement.
 isSelected(): Boolean
o This method is used to check whether the particular WebElement is selected or
not .

You might also like