Day 22
------
Locators
we can identify various elements on the web using Locators
Locators are addressed that identifya web element uniquely within the page.
------------
1. id
2. name
3. linkText
4. PartialLinkText
5 className
6. tagName
customized Locators
--------------------
1. CssSelector
[tag and Id]
[tag and class]
[tag and attribute]
[tag , class and attribute]
2. XPath
absolute xPath
Relative XPath
[Link](By.).action();
Tablets Table - PartialLinkText()
Submit Send - LinkText()
findElement() ---single webelement
findElements() ---multiple webelements
scanario 1: Locators mathing with single web element
findElement(Loc) --------->Signle web element return type ---> WebElement
findElements(Loc) --------->Signle web element return type ---> List<WebElement>
Sceanario 2: Locator is matching with multi web elements
findElement(Loc) --------->first web element return type ---> WebElement
findElements(Loc) --------->multiple web element return type --->
List<WebElement>
Scenario 3: Lo is not matching with any element/s
findElement(Loc) --------->No Such Element Exception return type --->
WebElement
findElements(Loc) --------->returns '0' [empty list] return type --->
List<WebElement>
Assignment
open application '[Link]/[Link]'
1. Total no. of links
2. Totla number of images
3. Click on Any link usng LinkText and PartialLinkText