В Calender элементы не перемещаются к предыдущей и следующей кнопке и посередине, как писать код в селене, веб-драйвер в Java-программе.
я попробовал этот код ниже
пакет com.s3sales.demo;
/*import java.util.Calendar;
import java.util.List;
*/
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;
public class S3sales {
public static void main(String[] args) throws InterruptedException {
WebDriver driver = new FirefoxDriver();
driver.get("http://sssamriddhisales.com/crm");
driver.findElement(By.id("userName")).sendKeys("admin");
Thread.sleep(3000);
driver.findElement(By.id("password")).sendKeys("admin123");
Thread.sleep(3000);
driver.findElement(By.className("btn-success")).click();
Thread.sleep(1000);
WebElement element = driver.findElement(By.linkText("Employee"));
Thread.sleep(1000);
Actions action = new Actions(driver);
action.moveToElement(element).moveToElement(driver.findElement(By.cssSelector("[data-id='empRegistration']"))).click().build().perform();
Thread.sleep(3000);
driver.findElement(By.id("newEmployee")).click();
driver.findElement(By.id("empFirstName")).sendKeys("Rakesh");
driver.findElement(By.id("empLastName")).sendKeys("Yadav");
String dateTime ="1993-10-09";
// button to open calendar
driver.findElement(By.id("empDob")).click();
WebElement nextLine=driver.findElement(By.xpath("//div[@class='next']"));
nextLine.click();
//button to move next in calendar
/*
Actions action1 = new Actions(driver);
WebElement driver1 = driver.findElement(By.xpath("//a[th(@class,'pre')]"));
driver1.click();*/
/* WebElement prevLine = driver.findElement(By.xpath("//div[th@class='prev']"));
prevLine.click();
*/
}
}
Исключение в потоке "main" org.openqa.selenium.NoSuchElementException:
Невозможно найти элемент: // div [@ class = 'next']
не найдено таких элементов, показывающих в консоли, где и не удается найти элемент, показывающий, пожалуйста, помогите мне ..