vendredi 26 mars 2021

How to read & enter line by line and make his own commands from [ priority 2 ] using Javascript in Eclipse

I've never used javascript to read a file line by line How to read & enter line by line and make his own commands from [ priority 2 ] using Javascript in Eclipse

@Test (priority = 1)
public static void file_reader() {
    try {
        FileReader reader = new FileReader("X:\\list.txt");
        BufferedReader bufferedReader = new BufferedReader(reader);

        String line;

        while ((line = bufferedReader.readLine()) != null) {
            System.out.println(line);
        }
        reader.close();

    } catch (IOException e) {
        e.printStackTrace();
    }
}



    @Test (priority = 2)
public void script() throws InterruptedException {
    driver.findElement(By.tagName("button")).click();
    Thread.sleep(6000);
    driver.findElement(By.id("btn-main")).click();
}

Aucun commentaire:

Enregistrer un commentaire