0% found this document useful (0 votes)
6 views1 page

Selenium Locators and Window Handling Guide

The document provides an overview of Selenium locators, specifically focusing on relative locators and their usage with tag names. It includes examples of how to find elements using CSS selectors and how to handle multiple windows in Selenium. Additionally, it outlines key areas for further learning, such as finding elements, XPath, CSS locators, waits, and actions in Selenium.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Selenium Locators and Window Handling Guide

The document provides an overview of Selenium locators, specifically focusing on relative locators and their usage with tag names. It includes examples of how to find elements using CSS selectors and how to handle multiple windows in Selenium. Additionally, it outlines key areas for further learning, such as finding elements, XPath, CSS locators, waits, and actions in Selenium.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

driver.

close()
[Link]()
[Link]()
[Link]()

--------------------------------------------------------------------------------
SELENIUM
LOCATORS---------------------------------------------------------------------------
---
Selenium Locators: Refer [Link]

Common Usage: When there is only tagname to identify an element.

--While using Relative Locators Import related Package manually.

--4 Locators:
above()
below()
toLeftof()
toRightof()

--Relative Locators can be only used with tagnames as of now.

Eg Syntax : WebElement dob =


[Link]([Link]("[for='dateofBirth']"));
[Link](with([Link]("input")).below(dob)).click();

To invoke a new window -[Link]().newWindow([Link]);


Set<String> handles=[Link]();

Iterator<String> it=[Link]();

String parentWindowId = [Link]();

String childWindow =[Link]();


Use iterator and its properties to handle the windows

-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
------------

Learnings Required:

Quickly go through Finding Elements and XPATH and CSS Locators


Understand Waits in SELENIUM
Actions in Selenium

You might also like