0

i have provided the condition when in if it works fine and after accepting the condition it is coming out of the loop and finding elements.but after executing else condition it is not finding the element after the else loop

if (identifier == "self") {
driver.findElement(By.xpath("//div[4]/div/div/div/div/div/label/span/input")).click();// CLICKING ON SELF TASK OR ASSIGN TO
Thread.sleep(2000);
}
else {
    driver.findElement(By.xpath("//div[@id='createTask_taskType']/label[2]/span[2]")).click();// CLICK ON ASSIGN TO 
driver.findElement(By.xpath("//form[@id='createTask']/div[5]/div/div[2]/div/div/input")).sendKeys(assign_to);
Thread.sleep(2000);
}
driver.findElement(By.xpath("//form[@id='createTask']/div[5]/div/div[2]/div/div/div/div/input")).click();
Thread.sleep(1000);
driver.findElement(By.xpath("//form[@id='createTask']/div[5]/div/div[2]/div/div/div/div/input")).sendKeys(start_date);//PLACING START DATES
Thread.sleep(1000);
driver.findElement(By.xpath("//form[@id='createTask']/div[5]/div/div[2]/div/div/div/div[3]/input")).sendKeys(end_date);//PLACING END DATES
driver.findElement(By.xpath("//form[@id='createTask']/div[5]/div/div[2]/div/div/div/div[3]/input")).sendKeys(Keys.RETURN);
Thread.sleep(1000);
driver.findElement(By.xpath("//div[@id='createTask_priority']/label[2]/span[2]")).click(); //click on priority low
//  Thread.sleep(3000);
New contributor
sabeeh is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
1
  • Sabeeh, it's hard to help you on this question without knowing the DOM structure you are working with. Can you edit our question with it? Sep 21 at 15:25

0

Your Answer

sabeeh is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy