0% found this document useful (0 votes)
174 views21 pages

Selenium Questions Answers

1. The document discusses various selenium concepts like navigation methods, waits, handling dropdowns, frames, windows and xpaths. 2. It provides the differences between driver.get() and driver.navigate().to(), implicit wait and explicit wait, getText() and getAttribute(), driver.close() and driver.quit(), absolute and relative xpaths. 3. Methods for handling dropdowns, frames, windows and performing page scroll are also explained.

Uploaded by

Krishna Raut
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
174 views21 pages

Selenium Questions Answers

1. The document discusses various selenium concepts like navigation methods, waits, handling dropdowns, frames, windows and xpaths. 2. It provides the differences between driver.get() and driver.navigate().to(), implicit wait and explicit wait, getText() and getAttribute(), driver.close() and driver.quit(), absolute and relative xpaths. 3. Methods for handling dropdowns, frames, windows and performing page scroll are also explained.

Uploaded by

Krishna Raut
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 21

1

Selenium Questions:

1. Difference in driver.get() and driver.navigate().to()

get() navigate().to()
navigate().to() method is used to open
get() method is used to open the specific url
specific url and also to navigate from one url
in browser.
to another url.
It will till all the elements in webpage are It will not wait till all the elements in
loaded. webpage are loaded.

Syntax: driverObjName.get(“website url”); Syntax: driverObjName.navigate().to(“url”);

2. Navigation methods in selenium


Navigation is interface in selenium.
Some methods are as follows:
 navigate().to():
It is used to open a URL or to navigate from one URL to other URL.
Syntax:
driverObjName.navigate().to(“url”); ------ Void

 navigate().back():
Used to navigate back in browser.
Syntax:
driverObjName.navigate().back (); ------ Void

 navigate().forward():
Used to navigate forward in browser.
Syntax:
driverObjName.navigate().forward (); ------ Void

 navigate().refresh():
Used to refresh the browser page.
Syntax:
driverObjName.navigate().refresh (); ------ Void
2

3. Difference between Implicit wait and Explicit wait.

Implicit Wait Explicit Wait


Implicit Wait time is applied to all the Explicit Wait time is applied only to those
elements in the script / webpage. elements which are intended by us.
In Implicit Wait, we need not specify In Explicit Wait, we need to specify
“ExpectedConditions” on the element to be “ExpectedConditions” on the element to be
located. located.

It is recommended to use when the elements


It is recommended to use when the are taking long time to load and also for
elements are located with the time frame verifying the property of the element
specified in Selenium implicit wait. like(visibilityOfElementLocated,
elementToBeClickable, elementToBeSelected).

4. Difference between getText() and getAttribute()

getText() getAttribute()

getText() method is used to capture the getAttribute() method is used to capture the
visible text present on the particular inner HTML attribute value of that particular
element. element.
We did not pass any parameter in this In this method we need to pass the parameter
method. as attribute key.
Syntax: Syntax:
WebEleName.getText(); WebEleName.getAttribute("attribute Key");

5. How to extract css property value


We can extract Css value by using getCssValue() method.
We have to provide property name parameter.
Syntax:
WebEleName.getCssValue("Property name");
The return type of this method is String. So we can store it in variable and print in o/p.

6. Difference between driver.close() and driver.quit()


3

driver.close() driver.quit()
close() method shall close the browser quit() method closes all the browser windows
window which is in focus. that are opened in current execution.
close() method closes the active WebDriver quit() method closes all the active WebDriver
instance. instances.
Syntax: driverObjName.close(); Syntax: driverObjName.quit();

7. How to handle dropdown elements with select tag and without select tag.
We can handle drop down in selenium with the help of Select class.
First we have to create object of Select class by passing drop down
WebElement instance.
Then by using that object we can handle the dropdown.
 To select option from drop down we can use three methods
 selectByIndex() ------ insert index integer.
 selectByValue() ------ insert value in String.
 selectByVisibleText() ------ insert visible text in String.

 To capture the selected option we use getFirstSelectedOption() method the return


type of this method is WebElement.
Then by using getText() method we capture the selected option, the return type
of this method is String. So we can store the captured option in String and then we
can print it.

 To count the options in drop down we use getOptions() method the return type of
this method is List of WebElement. i.e. List<WebElement>
Then by using size() method we can count the options. The return type of
this method is integer, so we can store the count number in int and then we can
print the count of options present in drop down.

 To print all options in drop down we use getOptions() method the return type of
this method is List of WebElement. i.e. List<WebElement>
Then by using Enhance for loop or for loop we can print all options in
dropdown.

To handle dropdown without Select class we can use Actions class method click() and also we
can use WebElement method click().

8. How to handle frames and windows?


4

Frames:
Frames are used to divide browser window i.e. webpage into multiple sections, where
each sections can load a separate HTML page.
There are top frame and child frame present in a webpage.
Whenever we access that particular webpage then the focus is on top frame. We are on
top frame then we have to switch to child frame.
We cannot switch child frame to child frame. First we have to switch to top frame then
we can switch to other child frame.
We can switch to child frame by using three ways,
 By using frame index id
Syntax:
driverObjName.switchTo().frame(int index);

 By using frame name


Syntax:
driverObjName.switchTo().frame(“name”);

 By using frame WebElement


Syntax:
driverObjName.switchTo().frame(“WebElement Instance”);

Return type of frame is WebDriver.


If we want to switch to top frame then we use defaultContent() method.
Return type of this method is WebDriver.
Syntax:
driverObjName.switchTo().defaultContent();

Windows:
We can handle tabs/ window by using getWindowHandle() method.
Return type getWindowHandle() method is String.

If we want to handle multiple tabs or window then we have to use


getWindowHandles() method.
Return type of getWindowHandles() method Set<String>.

Then by using if statement we can switch to another tab. This method is only helpful for 2 tabs.
For multiple tab handling we convert set of string into array list and then by using the index
position we can switch to any tab / window.
(then tell the syntax of if statement and array list as in methods.)

9. How to switch back to parent window?


5

We can handle tabs/ window by using getWindowHandle() method.


Return type getWindowHandle() method is String. So we store it in String variable and
by using driver.switchTo().window() method and passing the string variable parameter we
can switch to parent window.

In 2nd way we convert set of string into array list and then by using the index position we
can switch to any tab / window. So for parent window the index is always zero (0). So by
passing this zero index in driver.switchTo().window() we can switch to the parent window.

10. How to perform page scroll in selenium

11. How to click or send value to an element without using element.click() and
element.sendKeys()?
We can click or send value to an element by using Actions class methods.
Which are click() method, sendKeys() method, keyDown() method and keyUp() method.

In 2nd way by using JavaScript executor.

12. Difference between Absolute xpath and Relative xpath.

Absolute xpath Relative xpath


Absolute xpath uses complete path from root Relative xpath is a customized xpath or user
to the desired element. created xpath.
Absolute xpath starts with “/” single forward Relative xpath Starts with “//” double forward
slash. slash.

Absolute xpath identifies element fastly than Relative xpath can identify element slowly
relative xpath. than Absolute xpath.

Absolute xpath have more chances of failure


The failure chances of a well written relative
as any changes in any other element before
xpath is very less.
that element can change the Absolute xpath.

Eg.
Eg. //table/tbody/tr/th
/html/head/body/form/table/tbody/tr/th

13. Explain few Xpath functions


6

Relative xpath functions


 Relative xpath with single attribute:
Syntax:
//tagName[@Attribute= ‘Value’]

tagName: present in html code. Starting text of path of that particular element.
Attribute: it is the key value pair in html code. Like name, class, id, etc.
Value: it is the value of specific attribute key.

 Relative xpath with 2 attribute:


Syntax:
//tagName[@Attribute1= ‘Value1’] [@Attribute2= ‘Value2’]
//tagName[@Attribute1= ‘Value1’ and @Attribute2= ‘Value2’] (and operator)
//tagName[@Attribute1= ‘Value1’ or @Attribute2= ‘Value2’] (or operator)

 Relative xpath with text() method:


Syntax:
//tagName [text()= ‘Visible text value’]

 Relative xpath with contains() method with attribute:


Syntax:
//tagName [contains(@Attribute, ‘Value’)]
//tagName [contains(text() , ‘Visible text value’)]

 Relative xpath using starts-with() method with attribute:


Syntax:
//tagName [starts-with(@Attribute, ‘Value’)]
//tagName [starts-with(text() , ‘Visible text value’)]

 Relative xpath using following method:


Syntax:
//tagName[@Attribute= ‘Value’]// following :: tagName[@Attribute= ‘Value’]
//tagName[@Attribute= ‘Value’]// following :: tagName[1]

 Relative xpath using preceding method:


Syntax:
//tagName[@Attribute= ‘Value’]// preceding :: tagName[@Attribute= ‘Value’]
//tagName[@Attribute= ‘Value’]// preceding :: tagName[1]

We can also use text() method in following and preceding method

14. Mention few selenium exceptions


7

There are several Exceptions in selenium such as;


NoSuchElementException:
This is commonly seen exception as a subclass
of NotFoundException class.
The exception occurs when WebDriver is unable to find and locate
elements.

NoSuchFrameException:
When WebDriver is trying to switch to an invalid frame,
NoSuchFrameException under NotFoundException class is thrown.

NoSuchWindowException:
NoSuchWindowException comes under NotFoundException class. This is
thrown when WebDriver tries to switch to an invalid window.

NoAlertPresentException
NoAlertPresentException under NotFoundException is thrown when
WebDriver tries to switch to an alert, which is not available.

StaleElementReferenceException:
This exception says that a web element is no longer present in the web
page.

TimeoutException:
The TimeoutException occurs when the command that is currently in
execution and does not completed within the expected time frame.

ElementNotSelectableException:
This exception comes under InvalidElementStateException class.
ElementNotSelectableException indicates that the web element is present in the
web page but cannot be selected.

ElementNotVisibleException:
This exception comes under InvalidElementStateException class.
ElementNotVisibleException occurs when WebElement is present but it not
visible.

NoSuchAttributeException:
NoSuchAttributeException occurs when the attribute of the element
could not be located.

15. Difference between single slash and double slash.


8

single slash double slash

Single slash is used for absolute xpath. Double slash is used for relative xpath.

A single slash ‘/’ anywhere in xpath signifies  A double slash ‘//’ signifies to look for any
to look for the element immediately inside its child or any grand-child (descendant)
parent element.  element inside the parent element.

16. What are the scenarios that cannot be automated using selenium?
There are many things that cannot be done using Selenium WebDriver. Few of them
which I can list down are as follows:
Bitmap comparison is not possible using Selenium WebDriver.
Automating Captcha is not possible using Selenium WebDriver.
We cannot read bar code using Selenium WebDriver.
We cannot automate OTP submission using Selenium WebDriver.
There are more things that cannot be automated using Selenium WebDriver.

17. How to perform right click on selenium


For performing right click operation we have to use Actions class method.
By using contextClick() method we can perform right click operation.
The return type of contextClick() method is Actions class.
This method is overloaded in Actions class.
First we have to create object of Actions class by passing the WebDriver
instance.
Then by using this object and contextClick() method we can perform right click
operation.
Syntax:
Actions objAct = new Actions(WebDriver instance);

objAct.contextClick(WebElement instance).build().perform();

18. Action class and it's methods


9

By using Actions class we can perform keyboard and mouse events.


First we have to create an object of Actions class by passing the WebDriver
instance.
Then by using this object and WebElement instance we can perform mouse and
keyboard events.
Actions objActName = new Actions(WebDriver instance i.e. driverName);
WebElement wbName = driverName.findElement(By.id(""));
Mouse Events:
 click():
Clicks on the middle of the given element.
Return type of click() method is Actions class.
This method is overloaded in Actions class.
Syntax:
objActName.click(wbName).build().perform();

 doubleClick():
Double click on the middle of the given element.
Return type of doubleClick() method is Actions class.
This method is overloaded in Actions class.
Syntax:
objActName.doubleClick(wbName).build().perform();

 contextClick():
Right click on the middle of the given element.
Return type of contextClick() method is Actions class.
This method is overloaded in Actions class.
Syntax:
objActName.contextClick(wbName).build().perform();

 clickAndHold():
Clicks on the middle of the element and holds up to release.
Return type of clickAndHold() method is Actions class.
This method is overloaded in Actions class.
Syntax:
objActName.clickAndHold( wbName target).build().perform();

 dragAndDrop():
Drags the source element and drops at targeted element.
Return type of dragAndDrop() method is Actions class.
This method is overloaded in Actions class.
Syntax:
objActName.dragAndDrop( wbName source, wbName target).build().perform();
 moveToElement():
10

Moves the mouse middle of the given element. Mouse over event.
Return type of moveToElement() method is Actions class. This method is overloaded
Syntax:
objActName.moveToElement( wbName target) .build().perform();

 release():
Release the pressed mouse button on at current mouse location.
Return type of release() method is Actions class. This method is overloaded
Syntax:
objActName.release().build().perform();

Keyboard event:
 keyDown():
It is used to press the given key.
Return type of keyDown() method is Actions class. This method is overloaded.
Syntax:
objActName.keyDown(Keys.KEYNAME) .build().perform();

 keyUp():
It is used to release the given key.
Return type of keyUp() method is Actions class. This method is overloaded.
Syntax:
objActName.keyUp(Keys.KEYNAME) .build().perform();

 sendKeys():
It is used to enter data in the active element.
Return type of keyUp() method is Actions class. This method is overloaded.
Syntax:
objActName.sendKeys(“Value to send”) .build().perform();

19. Which faster driver in selenium


HTML UnitDriver is the most light weight and fastest implementation browser of
WebDriver. It is based on HtmlUnit.
It is known as Headless Browser Driver.
It is same as Chrome, IE or Firefox driver but it does not have GUI so one cannot
see the test execution on screen.

20. Can we create an object of the WebDriver() in selenium?


We cannot create an object of WebDriver because it is an Interface.
WebDriver, WebElement, Timeouts, Alert, Options.

21. What is StaleElementReferenceException and how to handle it?


11

This exception says that a web element is no longer present in the web page.
This exception is not the same as ElementNotVisibleException.
StaleElementReferenceException is thrown when an object for a particular web element
was created in the program without any problem and however; this element is no longer
present in the window. This can happen if there was a
 Navigation to another page
 DOM has refreshed
 A frame or window switch

Example:
WebElement firstName = driver.findElement(By.id(“firstname”));
driver.switchTo().window(Child_Window);
element.sendKeys(“Aaron”);

In the code above, object firstName was created and then the window was switched.
Then, WebDriver tries to type ‘Aaron’ in the form field.
In this case StaleElementReferenceException is thrown.

Avoiding and Handling:


Confirm that we are trying to do the action in the correct window. To avoid
issues due to DOM refresh, we can use Dynamic Xpath.

Example:
Say ‘id’ of a username field is ‘username_1’ and the xpath will
be //*[@id=’firstname_1?].
When you open the page again the ‘id’ might change say to ‘’firstname _11’.
In this case, the test will fail because the WebDriver could not find the element.
and StaleElementReferenceException will be thrown.

In this case, we can use a dynamic xpath like,


try
{
driver.findElement(By.xpath(“//*[contains(@id,firstname’)]”)).sendKeys(“Aaron”);
}
catch (StaleElementReferenceException e)
{
Catch statement
}
In the example above dynamic XPATH is used and if the exception is still found, it is caught.

22. What is use WebDriver driver=new ChromeDriver();


12

By using WebDriver driver= new ChromeDriver() we actually open the blank


chrome browser.
By giving reference of WebDriver we can call all implemented methods of
WebDriver interface.
Here we achieve upcasting.

23. How to lunch headless script

We can launch headless browser / script with the help of ChromeOptions class.
First we have to create object of ChromeOptions class.
Then we use addArguments() method and under the argument we pass “--headless”
Then we pass the ChromeOptions object name in ChromeDriver constructor.
We write above script first.

Syntax:
System.setProperty("webdriver.chrome.driver", "Path of chrome driver");

ChromeOptions objName =new ChromeOptions();

opt.addArguments("--headless");

WebDriver driverName = new ChromeDriver(objName);

24. What the different interface in selenium.

There are several interface present in the Selenium. Some of them are as follows,
SearchContext is the parent interface of all interface present in Selenium.
WebDriver,
WebElement,
OutputType
Navigation
Options
Timeouts
Window
TargetLocator
TakesScreenshot

25. Difference between findElement() and findElements()


13

findElement() findElements()

findElement() is used to find specific one findElements() is used to find elements


element in webpage. having similar tag or locator in webpage.

The return type of findElement() is The return type of findElements() is List of


WebElement. WebElement. i.e. List<WebElement>

Throws exception NoSuchElementException


Returns an empty list if there are no web
if there are no elements matching the locator
elements matching the locator strategy.
strategy.

26. Difference between build() and perform()

build() perform()

build() method is used to combine multiple perform() method is used to execute each
actions in single statement. and every statement / action.

return type of build() method is Action class return type of perform() method is void

27. What is Locator and its type?


Locator is an address that identifies a web element uniquely within the web page.

Locator are the HTML properties of element.


Element locator are common for all the browsers.
Selenium web driver use 8 different locator
id
name
className
tagName
linkText
partialLinkText
cssSelector
xpath

28. WebDriver interface method


14

abstract method

get() void
getTitle String
getCurrentUrl String
getPageSource() String
close() void
quit() void

Navigation interface it is sub interface of web driver


navigate().to() void
navigate().back() void
navigate().forward() void
navigate().refresh() void

Window class:
maximize() void
minimize() void
setSize() void

Dimension class
cons with 2 int arument/parameter width and height
driver.manage().window().setSize(d) void

findElement() WebElement ---- method overloading

29. WebElement interface method

isDisplayed() boolean
isEnabled() boolean
isSelected() boolean
click() void
sendKeys() void
getText() String
getAttribute() String
clear() void

30. Count how many link in web page?


15

Link on any web page are given anchor tag name i.e. “a”.
By using tag name locator as “a” and findElements() method we can find the
total links on webpage the return type of findElements() method is list of WebElement.
Then by using size() method we can get the count of links, the return type of
size() method is integer. So we can store it in integer and print it in output console.
Then by using enhance for loop we can print all links in output.

List<WebElement> ls =driver.findElements(By.tagName("a"));
int a =ls.size();

31. How to handle Alert popup in selenium?


We can handle alert popup in selenium with the help of Alert interface.
First we have to switch focus from main window to the alert popup so we use,
driver.switchTo().alert(); method, return type of this method is Alert interface.
Syntax:
Alert altName = driver.switchTo().alert();
In Alert interface there are 4 methods are available.
1. accept():
When we want to click on ok button on alert popup we use accept() method.
Return type of accept() is void.
Syntax:
altName.accept();

2. dismiss():
When we want to click on cancel button on popup we use dismiss() method.
Return type of dismiss () is void.
Syntax:
altName.dismiss();

3. getText():
If we want to capture visible text present on popup we use getText() method.
Return type of getText() is String.
Syntax:
altName.getText();

4. sendKeys():
If we want to enter any data in popup text box we use sendKeys() method.
Return type of sendKeys() is Void.
Syntax: altName.sendKeys ();
32. How to handle Static table?
16

Static tables are present in web page.


We perform following operations on static table;
1) Capture the value:
To capture the particular value we can use findElement() method with getText()
method, return type of getText() is String, so we can store it in String and we can
print it in output console.
Syntax:
String a =driver.findElement(By.xpath("//td[text()='Amit']")).getText();

For following methods first we use findElement() method to find the particular
table, the return type of findElement() is WebElement. So we store it in
WebElement instance and then we use that instance.
Syntax:
WebElement wbTable =driver.findElement(By.id("Employee"));

2) Count rows in table


To count total no of rows in that particular table, first we use findElements()
method and tagName locator generally the tag name for rows is “tr”, the return
type of findElements() method is List of WebElement. Then we use size() method
the return type of size() is integer so we can store it in integer and print it in
output console.
Syntax:
List<WebElement> lsRow =wbTable.findElements(By.tagName("tr"));
int rowCount =lsRow.size();
System.out.println(rowCount);

3) Count column in table:


To count total no of column in that particular table, first we use findElements()
method and tagName locator generally the tag name for column is “th”, the
return type of findElements() method is List of WebElement. Then we use size()
method the return type of size() is integer so we can store it in integer and print
it in output console.
Syntax:
List<WebElement> lsCol =wbTable.findElements(By.tagName("th"));
int colCount = lsCol.size();
System.out.println(colCount);

4) Count records in table


17

To count total no of records in that particular table, first we use findElements()


method and tagName locator generally the tag name for records is “td”, the
return type of findElements() method is List of WebElement. Then we use size()
method the return type of size() is integer so we can store it in integer and print
it in output console.
Syntax:
List<WebElement> lsData =wbTable.findElements(By.tagName("th"));
int dataCount = lsData.size();
System.out.println(dataCount);

33. What is Synchronization?


It is process of matching two or more activities/process in time.
during the test execution test tool give instruction one by one with same speed
but AUT takes less time for some steps execution and more time for some step
execution in order to keep them in sync then Synchronization is required.
Types of Synchronization
1) Unconditional Synchronization:
In Unconditional Synchronization we specify timeout value, we will make tool to
wait certain amount of time and then process.
When we give unconditional sync then we forcefully pause the execution process
for given time. After time completion the process resumes.
Ex. Thread.sleep(time in miliseconds);

2) Conditional Synchronization:
Conditional synchronization does not used for all commands/ statement in the
program.
It works only for findElement() and findElements() method only.
There are two types in conditional sync
i) ImplicitlyWait:
The implicitlyWait in selenium WebDriver is used to tell web driver to wait
certain amount of time before throws a NoSuchElementException.
Once we set the time then WebDriver will wait for element before throwing the
exception.
It also known as global wait, it is applicable for all the element in web page
Return type of implicit wait is TimeOuts interface
Method overloading
Syntax:
driver.manage().timeouts().implicitlyWait(timeout,TimeUnit.SECONDS);

ii) ExplictWait:
18

The explicit wait in selenium is used to tell web driver to wait certain condition
(ExpectedConditions) or maximum time exceed before throwing an exception.
It is apply for single element/ object in webpage.
Once we declare explicit wait we have use expectedConditions .
Method overloading.
First we have create object of WebDriverWait by passing WebDriver instance
and time in seconds
Syntax:
WebDriverWait wait =new WebDriverwait(driver,30);

wait.until(ExpectedCondition.visibilityOfElement(By.id("")));

Return type of until is WebElement.

3) Fluent wait:
It is used to change the repetition cycle of finding element.
By default the cycle is repeated in 255 milliseconds
syntax:
Wait wait =new FluentWait(driver)
.withTimeout(Duration.ofSeconds(20))
.pollingEvery(Duration.ofSeconds(2))
.ignoring(Exception.class)

1)text box operation:


i)check displayed status isDisplayed();
ii)check enabled status isEnabled();
iii)enter the value in text box sendKeys("data");
iv)capture the entered value in text box getAttribute('value');
v)clear the value in text box clear();

2)operation on button
i)check displayed status isDisplayed();
ii)check enabled status isEnabled();
iii)return the button value getAttribute('locator');
iv)click on button click();

3)operation on link
19

i)check displayed status isDisplayed();


ii)check enabled status isEnabled();
iii)capture the link name getText();
iv)click on link click();

4) operation on radio button


1) check female displayed status true isDisplayed() boolean
2) check female enabled status true isEnabled() boolean
3) check female selected status false isSelected() boolean
4) click female click() void
5) check female selected status true isSelected() boolean
6) click on male radio button click() void
5) check female selected status false isSelected() boolean

5) operation on drop down


> check displayed status of dp
> check enabled status
> select drop down value
> count drop down value
> check selected value
> check specific value is present in drop down or not?

6) operation on images:
there are 3 types of image
1) general image
> check displayed
2) image button
>> check displayed
> enabled status
> click
> capture the image button value
3) image link
> displayed status
> enbled status
> click on image link

7)capture error test area or error message


> return the error message --getText() String

8) operation on table
20

> get cell count


> Row count
> get cell value
> check specific value is present in cell
table table
table heading th
row tr
table data td

9)capture error test area or error message


> return the error message --getText() String

10) Operations on browser:


1) open a browser
WebDriver driverObjName = new ChromeDriver();
2) open a url
driverObjName.get(“website url”);
3) navigate from one url to another url
driverObjName.navigate().to(“url”);
4) navigate back
driverObjName.navigate().back ();
5) navigate forward
driverObjName.navigate().forward ();
6) refresh the browser
driverObjName.navigate().refresh ();
7) minimize
driverObjName.manage().window().minimize();
8) maximize
driverObjName.manage().window().maximize();
9) Full screen
driverObjName.manage().window().fullScreen();
10) Set size or to change the size of browser
driverObjName.manage().window() .setSize(Dimension targetSize);
11) close current window
driverObjName.close();
12) close all the tab
driverObjName.quit();

method overloaded in selenium


21

- page load time out


- implicit wait
- frame
- findELement
- find Elements
- getScreenshotAs
-keyDown in actions class
-sendKeys in actions class

constructors
actions
select
dimension

You might also like