Selenium Notes 1
Selenium Notes 1
1. History of Selenium
2. Selenium Architecture
3. Selenium Java Architecture
4. Locators
4.1 X path
4.1.1 Handling completely dynamic elements
5. WebElement
5.1 Font Size
5.2 Height
5.3 Color
5.4 Etc.
6. Handling Dropdowns (Sorting, Duplicates)
7. TakesScreenshot
7.1 Generic methods to capture the screenshot
8. Pop-ups (6 Pop-ups along with window popup)
9. Frames
10. JavaScriptExecuter
10.1 Pass the data
10.2 Clear the data
10.3 Performs scroll action
10.4 Scroll down to specific element
10.5 Zoom in and zoom out the pages
11. Data Driven Testing
12. Read single data from Excel
12.1 Write single data into Excel
12.2 Read multiple data from Excel
12.3 Write multiple data into Excel
12.4 Generic read data
13. Synchronization
13.1 Implicit Wait
13.2 Explicit Wait
13.3 Fluent Wait
14. TestNG
14.1 Assertions
14.2 Parallel Execution
14.3 Groups
14.4 Dependencies
14.5 Parameters
14.6 Listeners
15. PageObjectModel (POM)
15.1 Integrating Generic Methods
16. Hybrid Framework
17. Maven Project
17.1 Conversion of Java Project to Maven
17.2 Adding Dependencies
17.3 Adding Plugins
17.4 Execution of Framework
18. GitHub
18.1 Push
18.2 Pull
18.3 Commit
18.4 Merge
19. Genkins
20. Reporting Tools
20.1 Log4J
20.2 Extent Reports
21. Property Files
22. Java Database Connectivity (JDBC)
1.History of Selenium
2.Selenium Architecture
Client Binding/ Selenium
Language Binding Driver Browser
Server
Java
C# WebDriver Chromedriver.ex
Python Chrome
Version e
Ruby Mozilla Firefox
Java Script 3.141.59.jar Geckodriver.exe
Etc.
14 Programming
Action JSON Wire Protocol
Languages
package basicScripts;
import org.openqa.selenium.chrome.ChromeDriver;
public class Script1
{
public static void main(String[] args)
{
String key = "webdriver.chrome.driver";
String value = "./Softwares/chromedriver.exe";
System.setProperty(key, value);
ChromeDriver driver=new ChromeDriver();
}
}
package basicScripts;
import org.openqa.selenium.firefox.FirefoxDriver;
package basicScripts;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
Note: Here ‘ . ’ represents current Java project and ‘ / ’ represents to navigate from one
folder to another.
Extends
WebDriver
Implements
Remote WebDriver
Extends Extends
Extends
Search Context is the super most Interface which has 2 Abstract Methods.
Web Driver is an Interface that extends Search Context and it has 13 Abstract
Methods (11 Abstract Methods + 2 Extended Abstract Methods).
Remote WebDriver is a class that Implements WebDriver and it consists of 13
Concrete Methods. All the properties of WebDriver are Implemented in Remote
WebDriver, so it is called Implementation Class.
Around 2000 class Inherit from Remote WebDriver, but only 6-7 are browser classes.
WebDriver driver = new ChromeDriver()
Throughout the architecture the Selenium tool takes the support of Java language
with concepts such as Inheritance, Upcasting, Abstraction, Overriding, Operators,
Constructor, Keywords, etc.
1. Close() void
2. findElements()
3. equals(Object obj): Boolean – Object
findElements
findElements(Bya
{
Public static void main(String[] args)
Throws InterruptedException
{
System.setProperty(key,value);
WebDriver driver=new ChromeDriver();
Thread.sleep(2000);
driver.close(); //Closes single tab
driver.quit(); //Closes all tabs
}
Close Quit
1. It closes single tab. 1. It closes all the tabs.
2. It doesn’t kill the backend process. 2. It kills the backend process.
package basicScripts;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
package basicScripts;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
System.setProperty("webdriver.chrome.driver","./Softwares/chromedriver.
exe");
WebDriver driver=new ChromeDriver();
Thread.sleep(2000);
driver.manage().window().maximize();
driver.get("https://www.facebook.com");
String title= driver.getTitle();
System.out.println(title);
String url=driver.getCurrentUrl();
System.out.println(url);
String src=driver.getPageSource();
System.out.println(src);
}
}
Note:
1. Get() method is used to enter the URL.
2. It is mandatory to have internet connection to launch any URLs.
3. Get() method waits until the page gets loaded, then only it will go till next statement.
4. In Get() method it is mandatory to pass protocols, else it throws
InvalidArguementException (Selenium RTE).
For Example: https, http, etc
For Example: Get(https://www.facebook.com);
HTML
Parts of HTML
HTML
<html>
<head>
<title> Testing Page </title>
</head>
<body>
USN <input type=”text”><br><br>
PSW<input type=”text”><br><br>
<input type=”button” value=”login”><br><br>
CB<input type=”checkbox”><br><br>
RB<input type=”Radio”>
</body>
</html>
Note:
1. In order to write HTML code, we use Notepad of Editplus.
2. HTML code should be saved with .html extension
3. The only way to access HTML code is browser.
Locators
1. In Selenium before performing any actions such as click, clear or pass data, first we
have to find the element or locate the element or inspect the element, this is called
Locators.
2. In Selenium, Locators are classified into 8 types, which are Static methods that
belongs to “By” class and it is an Abstract class.
3. Based on the performance wise Locators are classified as:
a. tagName()
b. id()
c. name()
d. className()
e. linkText()
f. partialLinktext()
g. cssSelectors()
h. X-path() ***Important***
Write a script to perform click action on a link by using
tagName() Location
System.setProperty("webdriver.chrome.driver","./Softwares/chromedriver.exe");
WebDriver driver=new FirefoxDriver();
driver.get(“url”);
Thread.sleep(2000);
WebElement ele= driver.findElement(By.tagName(“a”));
Ele.click();
//or
driver.findElement(By.tagName(“a”)).click();
<html>
<body>
<a id=”a1” name=”n1” class=”c1” href=www.facebook.com>facebook</a><br>
</body>
</html>
Characteristics of findElement
driver.findElement(By.tagName(“a”)).click();
In the browser find the element by Tag name as “a” and perform click action on it.
Write a script to
driver.findElement(By.id(“a1”)).click();
In the browser find the element by Id as “a1” and perform click action on it.
Write a script to
driver.findElement(By.name(“n1”)).click();
In the browser find the element by name as “n1” and perform click action on it.
Write a script to
driver.findElement(By.className(“c1”)).click();
In the browser find the element by className as c1 and perform click action on it.
Write a script to pass the data into the text field by using tagName
Locator
In Selenium we use sendKeys method to pass the data and it takes sequence of characters as
a parameter.
Source Code
Explanation: In the browser we use find the element by tagName as “input” and pass the
data by using sendKeys as “Selenium”.
Write a script to pass the data into the text field by using Id Locator
Source Code
driver.findElement(By.id(“input”)).sendKeys(“selenium”);
Explanation:
In Selenium we use clear method to remove the data from the text field.
Source Code
X-Path
In Absolute X-path we use single forward slash (/) to navigate from parent to immediate
child.
html
Body
Div
Input A
Input B
Div
Input C 4
Input D
Note:
In X-path indexing starts from 1.
If the Tag name repeats under the same parent, then increment the index by 1.
In order to merge multiple X-paths we use Pipeline operator (|).
To merge n number of X-paths we use n-1 number of times Pipeline operators.
X-path by attributes
In X-path we can specify the attributes and relative way of writing the X-path is preferable.
Syntax: //tag[@AN=’AV’]
@ -> It searches for the element in all the directions.
//input[@id=’login.signin’]
//input[@placeholder=’Search’]
//a[@id=’createacc’]
Write an X-path by using multiple attributes
<html>
<body>
<table border =1>
<tbody>
<tr>
<td>1</td>
<td>Martin</td>
<td>50</td>
</tr>
<tr>
<td>2</td>
<td>KGF</td>
<td>200</td>
</tr>
<tr>
<td>3</td>
<td>Kantara</td>
<td>220</td>
</tr>
</tbody>
</body
</html>
DRAW DIAGRAM
//td[text(),’Martin’]//../td[3]
In the above example Martin is a Static element (Independent) and Movie Collection is a
Dynamic element.
//p[text(),’Python’]//../p[2]
//p[.,’JavaScript’//../p[4]
Siblings Function
1. Navigating from one child to another child element is called as Siblings in X-path.
1. In X-path Siblings are classified into 2 types:
a. Following Sibling
b. Preceding Sibling
Following Sibling – It highlights the elements which are downwards in the HTML
tree structure or towards the right side in a webpage.
Syntax: Static Xpath/following-sibling::tag
:: -> Scope Resolution Operator
tr
td A
td 1
td Martin
td 50
td B
//td[text(),=’Martin’]/following-sibling::td[1]
Inspect element p by keeping a as Static in a Dummy page
//td[text(),=’A’]/following-sibling::td[4]
//p[text()=’Python’]/following-sibling::p[3]
Preceding Sibling - It highlights the elements which are upwards in the HTML tree
structure or towards the left side in a webpage.
Syntax: Static Xpath/preceding-sibling::tag
//td[text()=’Martin’]/preceding-sibling::td[2]
//a[text()=’API Docs’]/../preceding-sibling::p[2]
Ancestor Tag
Note:
/ -> Navigate from Parent to immediate Child.
// -> Navigate from Parent to any Child.
/.. -> Navigate from Child to immediate Parent.
Siblings -> Navigate from one Child to another Child.
Ancestor -> Navigate from Child to any Parent.
tbody
tr
td 1
td A
td 66
tr
td 2
td B
td 99
tr
td 3
td C
td 33
1->A //td[text()=’1’]/following-sibling::td[1]
3->33 //td[text()=’3’]/following-sibling::td[2]
99->2 //td[.=’99’]/preceding-sibling::td[2]
66->A //td[.=’66’]/preceding-sibling::td[1]
A->B //td[.=’A’]/../following-sibling::tr[1]/td[2]
1->99 //td[.=’1’]/../following-sibling::tr[1]/td[3]
C->1 //td[.=’C’]/../preceding-sibling::tr[2]/td[1]
33->99 //td[.=’33’]/../preceding-sibling::tr[1]/td[3]
C->B->A //td[.=’C’]/../preceding-sibling::tr[1]/td[2]/../
preceding-
sibling::tr[1]/td[2]
66->99->33 //td[.=’66’]/../following-sibling::tr[1]/td[3]/../
following-sibling::tr[1]/td[3]
B->A->3 //td[.=’B’]/../preceding-sibling::tr[1]/td[2]/../
following-sibling::tr[2]/td[1]
A->99->66->3 //td[.=’A’/../following-sibling::tr[1]/td[3]/../
preceding-sibling::tr[1]/
td[3]/../tr[2]/td[1]
1. In real time, if we are not able to locate the element by using attributes, multiple
attributes, text, contains, etc. Then we go for X-path by Grouped Index.
2. Here, the main agenda is to locate the element and get the count as 1.
3. In X-path we use grouped index to achieve it.
4. Syntax: (Xpath)[index]
– Here, we specify the X-path inside the parenthesis and specify the index inside the
square brackets.
Xpath – Priority 1
Index – Priority 2
A A B
B C D
Ex1: (//input)[2] C
Ex2: (//input[1])[1] D
Ex3: (//input[2])[2]
In the above examples, as soon as we specify the parenthesis all the matching elements will
get dumped inside X-path array and based on the index specified it will highlight the
matching element.
(//div[text()=’Rs.149’)[3]
Sample HTML Source Code
<html>
<body>
<input type="checkbox">1</input><br>
<input type="checkbox">2</input><br>
<input type="checkbox">3</input><br>
<input type="checkbox">4</input><br>
<input type="checkbox">5</input><br>
<input type="checkbox">6</input><br>
<input type="checkbox">7</input><br>
<input type="checkbox">8</input><br>
<input type="checkbox">9</input><br>
<input type="checkbox">10</input><br>
</body>
</html>
WebElement
1. WebElement is an Interface which consists of 17 abstract methods.
2. All the methods of WebElement are used to perform action on elements inside the
webpage. The actions include click, clear, sendkeys, etc.
Methods of WebElement Interface
driver.get("http://www.facebook.com");
Thread.sleep(1500);
WebElement ele = driver.findElement(By.id("Email"));
boolean b = ele.isDisplayed();
if(b)
{
System.out.println("is displayed");
}
else
{
System.out.println("not displayed");
}
Driver.get(“URL”);
Thread.sleep(2000);
WebElement ele = driver.findelement(by.id(“domain1”));
Boolean b=ele.isSelected();
If(b)
{
Sysout(“Element selected”);
}
Else
{
Sysout(“element not selected”)
}
Handling keyboard functionalities
1. In Selenium to handle the keyboard we use Keys.
2. Keys is inherited from Enum and it also an example for Enum.
3. All the member inside keys are public static final variables.
4. In Eclipse final members are represented in dark blue color.
Write a script to clear the data from text field by using Keys
<html>
<body>
<input type =”text” id=”a1” value= “hello”>
</body>
</html>
Driver.get(“URL”);
Thread.sleep(2000);
webElement ele=driver.findElement(By.id(“a1”));
ele.sendKeys(Keys.CONTROL+”a”);//select all
Thread.sleep(2000);
Ele.sendKeys(Keys.DELETE);//deletes data
<html>
<body>
<a id=”a1” href=”url”>google</a><br>
<a id=”a2” href=”url”>Facebook</a>
</body>
</html>
driver.get("URL");
List<WebElement> links = driver.findElements(By.xpath("//a"));
int count = links.size();
System.out.println(count);
}
for(int i=count-1; i>=0; i--)
{
WebElement we = inpt.get(i);
we.click();
}
Note: If we try to perform deselect action on a single select dropdown then it throws
UnsupportedOperationException (Java RTE).
***************PAGE LEFT FOR PREVIOUS TOPIC SIR SHOULD GIVE*****************
Note: If you are unable to inspect element from right click on the element. Click on inspect
on any other element and then click on Toggle Device Toolbar (Ctrl+Shift+M).
Handling Click and Hold Action
In Selenium to perform click and hold action we use Actions class. Here, we invoke a method
called clickAndHold and parameterize it with address of the element. perform method is
mandatory.
Write a script to perform Click and Hold Action
driver.get("https://demoapps.qspiders.com/ui/clickHold?sublist=0");
WebElement candh = driver.findElement(By.id("circle"));
Actions act = new Actions(driver);
act.clickAndHold(candh).perform();
Actions Methods
Mouse Hovering Action moveToElement()
Drag and Drop dragAndDrop(source,destination)
Double Click doubleClick()
Right Click contextClick()
Click and Hold clickAndHold()
Robot Class
Robot class from Java (AWT Package): It is an inbuilt class in Java which is inherited to
Selenium. In order to access Robot class, we invoke AWT package (Abstract Window
Toolkit).
Actions related to the keyboard or cursor (mouse actions) AWT package can be used.
Why Robot Class?
It is used in Selenium because for few test cases, the user should have control over
the keyboard functionalities or mouse actions. In instances such as minimizing the
browser, opening in new tab, handling download popups, etc.
In Robot class, KeyEvent class is used for keyboard functionalities and also, we use
keyPress or keyRelease to perform the actions.
All the events inside the Robot class are performed virtually.
Write a script to right click on an element and open it in new tab
driver.get("https://www.google.com/");
WebElement rclick = driver.findElement(By.xpath("//a[text()='ಕನ್ನಡ']"));
Actions act = new Actions(driver);
act.contextClick(rclick).perform();
Robot r=new Robot();
r.keyPress(KeyEvent.VK_T);
r.keyRelease(KeyEvent.VK_T);
Write a script to minimize the browser, close the browser without
using quit or close
driver.get("https://www.google.com/");
Robot r = new Robot();
r.keyPress(KeyEvent.VK_ALT);
r.keyPress(KeyEvent.VK_SPACE);
r.keyPress(KeyEvent.VK_N);
r.keyRelease(KeyEvent.VK_ALT);
r.keyRelease(KeyEvent.VK_SPACE);
r.keyRelease(KeyEvent.VK_N);
driver.manage().window().maximize();
r.keyPress(KeyEvent.VK_ALT);
r.keyPress(KeyEvent.VK_F4);
r.keyRelease(KeyEvent.VK_ALT);
r.keyRelease(KeyEvent.VK_F4);
JavaScriptExecuter
In Selenium to handle disabled elements and also to perform scroll action, we use
JavaScriptExecuter (JSE).
JSE is an Interface, which consists of 2 Abstract Methods.
In order to access these methods, we explicitly type caste from Webdriver to JSE.
JavaScriptExecuter jse = (JavaScriptExecuter) driver;
***********Insert Diagram*********************
Methods of JSE
1. executeAsyncScript(String arg0, Object
2. executeScript
Source Code
<html>
<body>
UN: <input type="text" id="a1" value="admin" disabled>
</body>
</html>
Write a script to handle disabled element and pass the data
driver.get("file:///C:/Users/Ashrith%20R/OneDrive/Documents/QSpiders/Selenium/
HandlingDisabledElementUsingJSE.html");
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("document.getElementById('a1').value='hello'");
Write a script to handle disabled element and clear the data
driver.get("file:///C:/Users/Ashrith%20R/OneDrive/Documents/QSpiders/Selenium/
HandlingDisabledElementUsingJSE.html");
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("document.getElementById('a1').value=' '");
Note: Document is a class, which is partially implemented and value is a method which is
used to pass or clear the data and it overrides pre-existing data.
Write a script to perform scroll action thrice downwards and
upwards in a webpage
driver.get("https://www.amazon.com");
JavascriptExecutor js = (JavascriptExecutor) driver;
for(int i=0;i<3;i++)
{
js.executeScript("window.scrollBy(0,500)");
Thread.sleep(1500);
}
for(int j=0;j<3;j++)
{
js.executeScript("window.scrollBy(0,-500)");
Thread.sleep(1500);
}
Write a script to scroll down to the specific element and perform
the action
driver.get("https://www.amazon.com");
WebElement ele = driver.findElement(By.xpath("//a[text()='Sell apps on Amazon']"));
Point p = ele.getLocation();
int x= p.getX();
int y= p.getY();
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("window.scrollBy("+x+","+y+")");
Note: The output is of string type, since we are fetching the location of x and y and storing it
in a variable, we have to convert the variable to a string type, so we are using double quotes.
Advantages of JSE
1. It is used to handle disabled element.
2. It is used to perform scroll action.
3. It is used to pass and clear the data, without using sendKeys() or clear().
***********Absent Notes**************
Pop-ups
It is a Pop-up that we get usually when we try to fill webforms. Initially the control will be on
the page (Sign up) and once after we click on submit the control will switch from page to
Pop-up. To switch the Selenium control to the Pop-up we use alert interface. Here, we use
the statement called driver.switchTo().alert().
Characteristics
1. We can’t drag the Pop-up.
2. We cannot inspect the Pop-up.
Note:
In order to fetch the message printed on the Pop-up we use getText(), inherited from
alert interface.
To click on ok or anything similar we use accept method.
To click on cancel or anything similar we use dismiss().
Write a script to handle alert and confirmation pop-up
Note:
Since the developers use JavaScript language to develop this popup it is also called as
JavaScript popup.
If we try to implement Alert methods when there is no Alert popup, then it throws
NoAlertPresentException (Selenium RTE).
To copy the path of the file, Hold Shift -> Right Click -> Copy as Path
Synchronization
The process of matching Selenium speed with the application speed without using
Thread.sleep() is called Synchronization.
Limitations of Thread.sleep()
1. For n number of pages, we specify n-1 number of times Thread.sleep().
2. It waits until the specified time gets over, then only it will give the control to
next line.
In Selenium Synchronization can be handled in multiple ways.
1. Implicit Wait
2. Explicit Wait or Dynamic Wait
3. Fluent Wait
4. Wait For Pages
5. Custom Wait
6. Etc.,
Implicit Wait
It is used to handle the Synchronization of only two methods, that is., findElement()
and findElements().
This statement will be written only once throughout the script.
To specify the Implicit Wait, we write the below statement
driver.manage().timeouts().implicitlyWait(duration,timeUnit);
Implicit wait takes two parameters as an input, that is.,
1. Duration
2. Time Unit -> Example for Enum
In Implicit Wait Time Unit can be in
1. Days
2. Hours
3. MicroSeconds
4. MilliSeconds
5. Minutes
6. NanoSeconds
7. Seconds
Write a script to handle Synchronization by using Implicit Wait
{
System.setProperty("webdriver.gecko.driver","Softwares/geckodriver.exe/");
WebDriver driver = new FirefoxDriver();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("https://automation.lab/login.do");
driver.findElement(By.name("username")).sendKeys("admin");
driver.findElement(By.name("Password")).sendKeys("admin123");
driver.findElement(By.id("login button")).click();
driver.findElement(By.xpath("//div[text()='tasks']")).click();
driver.findElement(By.xpath("//div[text()='reports']")).click();
}
Element is present
or not
Yes No
Explanation
1. When the control comes to findElement()/findElements() it will verify whether
element is present or not.
2. If the element is present, it will return the address of the matching element.
3. If the element is not present then it will verify whether Implicit Wait is specified or
not.
4. If Implicit Wait is not specified then it will throw NSEE/Empty Array.
5. If Implicit Wait is specified then it will verify whether Implicit Wait time is over or
not.
6. If Implicit Wait is over then it will throw NSEE.
7. If Implicit Wait time is not over then it will wait for 0.5 seconds.
8. For every cycle it waits for 0.5 seconds is called as Polling period and the cycle
continues until:
a. Element is found.
b. Implicit Wait time gets over.
Explicit Wait
TestNG
TestNG is a unit testing framework used by developers to perform WBT.
Why Testers?
To run multiple scripts at one shot
To generate report/result
To achieve parallel execution
To perform verification (assertion)
Steps to download TestNG for Eclipse
Open Eclipse
Click on Help
Eclipse Marketplace
Search for TestNG
Install
Accept the risk
Finish
Steps to add TestNG to the project
Right click on the project
Build Path
Add Libraries
TestNG
Next
Finish
Note: J Unit is also a framework mainly used for WBT but using this we cannot achieve
parallel execution & no inbuild report generation is present.
Parameters of TestNG
How do you specify priority in TestNG
In TestNG to specify the priority, we use the parameter called “Priority”. By default, the value
of priority is zero. If the priority value is same, then it will execute based on the ASCII
(American Standard Code for Information Interchange).
Generic Script
Runner Script
SoftAssert or Verify
In real time even through the comparison gets failed and if we want to continue the
execution, we use SoftAssert.
Here we use a class called SoftAssert which is a concrete class and consists of non-
static members.
We also invoke a method class assertEquals and parameterize it will two arguments
such as Actual Result and Expected Result.
After the execution of SoftAssert, to consolidate we use assertAll() and it should
always be the last statement.
Write a script to perform verification by using SoftAssert
Syntax:
SoftAssert sa = new SoftAssert()
sa.assertEquals(Actual Result , Expected Result)
sa.assertAll();
Script:
{
@Test
public void runner()
{
System.setProperty("webdriver.gecko.driver", "./Softwares/geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("https://www.facebook.com");
String title = driver.getTitle();
SoftAssert sa = new SoftAssert();
sa.assertEquals(title, "hello");
System.out.println("India");
sa.assertAll();
}
}
Advantages of POM
1. It is used to handle StaleElementReferenceException.
2. To achieve Encapsulation.
3. POM is also called Object Repository (It stores Element addresses).
4. POM is classified into 3 stages:
a. Declaration
b. Initialization
c. Utilization
Declaration: In POM we declare the elements by using @FindBy (annotation) and
make it as private.
Syntax: @FindBy(AN = “AV”)
Private WebElement ele;
Runner Script
public class Demo1
{
@Test
public void validData() throws InterruptedException
{
System.setProperty("webdriver.gecko.driver","./Softwares/geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.get("https://www.facebook.com");
POMScript1 p = new POMScript1(driver);
p.passData();
Thread.sleep(1500);
driver.navigate().refresh();
Thread.sleep(1500);
p.passData();
}
}
******Write POM Script*************