I'm testing with the selenium webdriver, and getting an error. I have set the Ro.properties file and put all locator in properties file.
Below is the code that I am using, can anyone please help me out?
public class usePropertiesFile {
private WebDriver driver;
public static Properties prop = new Properties();
public static FileInputStream fip = null;
@BeforeTest
public void setup() throws IOException {
driver =new FirefoxDriver();
driver.get("http://gmail.com/");
driver.manage().window().maximize();
}
@AfterTest
public void Teardown() {
driver.quit();
}
@Test
public void testPropFile() throws Exception {
fip = new FileInputStream("C:\\Users\\src\\config\\RO.properties");
prop.load(fip);
driver.findElement(By.xpath(prop.getProperty("login_use"))).clear();
driver.findElement(By.xpath(prop.getProperty("login_use"))).sendKeys("userid");
}
}