0% found this document useful (0 votes)
13 views

archivetempCSSLocator Java

Uploaded by

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

archivetempCSSLocator Java

Uploaded by

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

import org.openqa.selenium.

*;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.By;//Add required imports

public class CSSLocator//DO NOT change the class name


{
String fname;
static WebDriver driver;
public WebDriver createDriver() //DO NOT change the method signature
{
driver=DriverSetup.getWebDriver();
return driver;
//Implement code to create Driver from DriverSetup and return it
}

public WebElement getCSSLocator(WebDriver driver) //DO NOT change the method


signature
{
WebElement element=driver.findElement(By.cssSelector("#username"));
return element;
/*Replace this comment by the code statement to get the Web element of username*/
/*Find and return the element */

public String getName(WebElement element) //DO NOT change the method signature
{
String fname=element.getAttribute("placeholder");
return fname;

//Get the attribute value from the element and return it


}

public static void main(String[] args){


CSSLocator pl=new CSSLocator();
driver=pl.createDriver();
WebElement element=pl.getCSSLocator(driver);
String hi=pl.getName(element);
//Add required code

}
}

You might also like