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

PropFileCode

The document contains a Java test class that uses Selenium WebDriver to automate a login process on a demo website. It sets up the ChromeDriver, loads user credentials from a properties file, and inputs the username and password into the respective fields. There are also commented-out lines for clearing the input fields after the test method execution.

Uploaded by

jadhavbs16
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)
0 views

PropFileCode

The document contains a Java test class that uses Selenium WebDriver to automate a login process on a demo website. It sets up the ChromeDriver, loads user credentials from a properties file, and inputs the username and password into the respective fields. There are also commented-out lines for clearing the input fields after the test method execution.

Uploaded by

jadhavbs16
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
You are on page 1/ 1

Properties

WebDriver dr;

@Test()
public void f() throws InterruptedException, IOException {

System.setProperty("webdriver.chrome.driver","C:\\Users\\pdeshpande\\
Desktop\\Desktopdata\\Jar\\chromedriver_win32 (5)\\chromedriver.exe");
dr= new ChromeDriver();

File file= new File("C:\\Users\\pdeshpande\\Test\\ttdf\\


test.properties");

FileInputStream readFile= new FileInputStream(file);


Properties prop=new Properties();
prop.load(readFile);
Thread.sleep(10000);
dr.get("https://demo.guru99.com/v4/");
dr.findElement(By.name("uid")).sendKeys(prop.getProperty("un"));
Thread.sleep(10000);
dr.findElement(By.name("password")).sendKeys(prop.getProperty("pw"));

}
@AfterMethod
public void afterMethod()
{
//dr.findElement(By.name("uid")).clear();
//dr.findElement(By.name("password")).clear();
}
}

You might also like