1

Selenium Webdriver でテストしていて、エラーが発生しました。Ro.properties ファイルを設定し、すべてのロケータをプロパティ ファイルに入れました。

以下は私が使用しているコードです。誰か助けてもらえますか?

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");
    }
}
4

2 に答える 2