Я пытаюсь выбрать дату из средства выбора даты и времени, и если я запустил один из кодов выбора даты, он будет успешно запущен, но когда я запущу код для них обоих. Я получаю сообщение об ошибке.
package testNgPackageTest;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.AfterClass;
public class InsightTalk {
public static WebDriver driver;
@Test (priority = 0)
public void insightTalk() {
driver.findElement(By.xpath("//*[text()='Insight Talks']")).click();
System.out.println("click on insight talk menu");
driver.navigate().refresh();
driver.findElement(By.xpath("//*[text()='Add Insight Talk']")).click();
System.out.println("click on insight talk create button");
driver.findElement(By.xpath("(//input[@type='text'])[1]")).sendKeys("soupraTalk");
System.out.println("click on insight talk name");
driver.findElement(By.xpath("//textarea[@class='md-textarea']")).sendKeys("soupramaitygrouptalje");
System.out.println("click on insight talk description");
//start date time picker
driver.findElement(By.xpath("(//input[@type='text'])[2]")).click();
System.out.println("click on insight talk start date time");
driver.findElement(By.xpath("//div[@class='vdatetime-calendar__navigation--next']")).click();
System.out.println("click on next button ");
driver.findElement(By.xpath("(//div[@class='vdatetime-calendar__month__day'])[16]")).click();
System.out.println("click on insight talk start date ");
driver.findElement(By.xpath("//*[text()='Ok']")).click();
System.out.println("click on ok button ");
driver.findElement(By.xpath("(//div[@class='vdatetime-time-picker__item'])[3]")).click();
System.out.println("click on time button ");
driver.findElement(By.xpath("//*[text()='Ok']")).click();
System.out.println("click on ok button ");
//end date time picker
driver.findElement(By.xpath("(//input[@type='text'])[3]")).click();
System.out.println("click on insight talk end date time");
driver.findElement(By.xpath("//div[@class='vdatetime-calendar__navigation--next']")).click();
System.out.println("click on next button ");
driver.findElement(By.xpath("(//div[@class='vdatetime-calendar__month__day'])[16]")).click();
System.out.println("click on insight talk end date ");
driver.findElement(By.xpath("//*[text()='Ok']")).click();
System.out.println("click on ok button ");
driver.findElement(By.xpath("(//div[@class='vdatetime-time-picker__item'])[4]")).click();
System.out.println("click on end time button ");
driver.findElement(By.xpath("//*[text()='Ok']")).click();
System.out.println("click on end ok button ");
}
Ошибка:
FAILED: insightTalk org.openqa.selenium.ElementClickInterceptedException:
Element <input id="" class="vdatetime-input" type="text"> is not
clickable at point (731,425) because another element <div
class="vdatetime-time-picker__item vdatetime-time-picker__item--selected">
obscures it