0

When performing data driven in a given field , the code for its implementation , not running the next step of the code.

//poi
    WebElement searchbox = driver.findElement(By.name("simcard"));

    try 
    {
      FileInputStream file = new FileInputStream(new File("C:\\paulo.xls")); 
      HSSFWorkbook workbook = new HSSFWorkbook(file);

      HSSFSheet sheet = workbook.getSheetAt(0);

      for (int i=1; i <= sheet.getLastRowNum(); i++)
      {
        String simcard = sheet.getRow(i).getCell(0).getStringCellValue();
        searchbox.sendKeys(simcard);                
        searchbox.submit();       
        driver.manage().timeouts().implicitlyWait(10000, TimeUnit.MILLISECONDS);

      }

     workbook.close();
     file.close();
    } 
    catch (FileNotFoundException fnfe) 
    {
      fnfe.printStackTrace();
    } 
    catch (IOException ioe) 
    {
      ioe.printStackTrace();

next steps that must be performed

driver.findElement(By.xpath("/html/body/table/tbody/tr[4]/td/div/form/table/tbody/tr[2]/td/center/table/tbody/tr[19]/td/a[1]/img")).click();

Someone has gone through this?

Mike Weber
  • 311
  • 2
  • 16
Paulo Roberto
  • 1,498
  • 5
  • 19
  • 42
  • 3
    _not running the next step of the code._, OK, so what _does_ it do instead? Are you getting an error? Show us the error message. In order for somebody to be able to help you, we need to know what you expected the program to do, and what it actually did do instead. And, of course, wee need to see at least, the lines of code where whatever it was happened (though that is not always enough.) – Solomon Slow May 08 '15 at 17:43
  • 1
    Where in your code should the findElement be placed? After the try-catch block? – Mike Weber May 08 '15 at 17:54
  • 1
    Also, I suggest looking here http://stackoverflow.com/questions/1822315/data-driven-tests-with-junit to do data driven testing. – Mike Weber May 08 '15 at 17:59
  • @jameslarge Nothing happens , that's what 's strange , there's nothing in Logcat , nothing on the console , no error on the screen , it simply freezes , as if he had been given a pause. – Paulo Roberto May 08 '15 at 18:09
  • 1
    Code seems working fine... It seems the problem is somewhere else... Can you share you Workbook...? – Sankumarsingh May 11 '15 at 04:45

1 Answers1

0

resolved, there were some errors in my code , since the fix

Paulo Roberto
  • 1,498
  • 5
  • 19
  • 42