How can I retrieve the next value from text file when there is a failure in the test case?
Here is my code:
public void openFile(){
try{
x = new Scanner(new File("C:\\Project1\\ids.txt"));
public void readFile(){
}
}catch(Exception e){
System.out.println("not find file");
}
while(x.hasNext()){
String a = x.next();
driver.findElement(By.xpath("//*[@id=\"in_member_id\"]")).sendKeys(a);
}
}
If the value in line number 1 of file ids.text
is wrong I want it to put the second value then the third and so on. If it's right I want it to continue to the last of the file.