-
Notifications
You must be signed in to change notification settings - Fork 0
/
Datepicker.java
28 lines (23 loc) · 1.02 KB
/
Datepicker.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package VINDVG1.Vinay27;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import io.github.bonigarcia.wdm.WebDriverManager;
public class Datepicker {
public static void main(String[] args) throws InterruptedException {
WebDriverManager.chromedriver().setup();
WebDriver driver=new ChromeDriver();
driver.get("https://jqueryui.com/datepicker/");
driver.manage().window().maximize();
//Introducing new variable r
WebElement r=driver.findElement(By.xpath("//*[@id=\"content\"]/iframe"));
driver.switchTo().frame(r);
//introducing new variable Ab
WebElement Ab=driver.findElement(By.id("datepicker"));Ab.click();
driver.findElement(By.xpath("//*[@id=\"ui-datepicker-div\"]/table/tbody/tr[4]/td[7]/a")).click();
System.out.println("calender Selected");
/*driver.get("https://demoqa.com/date-picker");
driver.findElement(By.xpath("//*[@id=\"datePickerMonthYearInput\"]"));*/
}
}