Back

Explore Courses Blog Tutorials Interview Questions
0 votes
4 views
in Java by (120 points)

I am having no such element error in the below Selenium code. It is not pointing any other page. the pointed field is in the same page...it's in a modal which belongs to the same page. Please find the code below:

public class Maincode {

       WebDriver driver = null;

  @Test

  public void Act() throws IOException, BiffException, InterruptedException{

         Reading rp = new Reading();

         System.setProperty("webdriver.chrome.driver","C:\\Users\\91963\\Desktop\\java things\\chromedriver_win32 version 81\\chromedriver.exe");

      driver = new ChromeDriver();

      driver.get("https://online.actitime.com/test22/login.do");

 

      File f1 = new File("C:\\Users\\91963\\Desktop\\Projects\\file1.xls");

        Workbook wb = Workbook.getWorkbook(f1);

        Sheet sh = wb.getSheet(0);

      

       for(int i = 1; i< sh.getRows(); i++)

       {  

     

      rp.getElement("unm",driver).sendKeys(sh.getCell(0,i).getContents());

     

     

      rp.getElement("Pswd",driver).sendKeys(sh.getCell(1,i).getContents());

     

     

      rp.getElement("log",driver).click();

    

    

}

      Thread.sleep(2000);

         driver.get("https://online.actitime.com/test22/user/submit_tt.do");

        

      driver.findElement(By.xpath("//div[@id='container_tasks']")).click();

     

      driver.get("https://online.actitime.com/test22/tasks/tasklist.do");

      driver.findElement(By.xpath("//div[@class='addNewButton']//div[@class='downIcon']")).click();

      driver.findElement(By.xpath("//div[@class='item createNewCustomer']")).click();

      driver.findElement(By.xpath("//div[contains(@class,'customerNameDiv')]//input[contains(@placeholder,'Enter Customer Name')]")).sendKeys("John");

 

I am trying to Automate few functionalities in Actitime website. 

Please log in or register to answer this question.

Related questions

Browse Categories

...