public class DatePicker extends AbstractElement
LOG_DEMARKER
Constructor and Description |
---|
DatePicker(ParentTraits parent,
String datePickerLocator)
Use this constructor to create a DatePicker contained within a parent.
|
DatePicker(String datePickerLocator)
Using this constructor will create a DatePicker object with default prev month, next month, day of month, and
date text (month and year) locators.
|
DatePicker(String datePickerLocator,
String controlName)
Use this constructor to override default controlName for logging purposes.
|
DatePicker(String datePickerLocator,
String controlName,
ParentTraits parent)
Use this constructor to create a DatePicker contained within a parent.
|
DatePicker(String datePickerLocator,
String prevMonthLocator,
String nextMonthLocator,
String dateTextLocator)
This constructor provides a way for users to initialize DatePicker for prev month, next month, and date text
(month and year) locators.
|
Modifier and Type | Method and Description |
---|---|
void |
clickDay(int dayOfMonth)
Click on the day-of-month tablet to select the desired day of the month to set date.
|
void |
clickNextMonth()
Advances one month to the future.
|
void |
clickPrevMonth()
Goes back one month in history.
|
void |
datePickerInit(String prevMonthLocator,
String nextMonthLocator,
String dateTextLocator)
DatePicker comes with default locators for widget controls previous button, next button, and date text.
|
String |
getDate()
This function return the current date of a date picker in the format of "MM/dd/yyyy"
|
String |
getDateText()
Gets the current setting month and year from the calendar header.
|
String |
getDayOfMonth()
Get the current day of month of a date picker.
|
String |
getMonth()
Get the current month of a date picker.
|
String |
getYear()
Get the current year of a date picker.
|
void |
reset()
Clears the date picker.
|
void |
setDate(Calendar to)
This is the main function of the DatePicker object to select the date specified by the input parameter.
|
void |
setDate(int year,
int month,
int day)
This function set the date on the DatePicker using the year, month and day provided.
|
void |
setDate(String date)
This function set the date on the DatePicker using the input paramter in the format of "MM.dd.yyyy" string
|
click, click, clickAndExpect, clickAndExpectOneOf, clickAndExpectOneOf, clickonly, getAttribute, getControlName, getDispatcher, getElement, getElements, getLocator, getParent, getProperty, getText, getValue, getWaitTime, hover, isElementPresent, isEnabled, isVisible, logUIAction, logUIActions, processScreenShot, resolveControlNameToUseForLogs, setParent, setProperty, validatePresenceOfAlert
public DatePicker(String datePickerLocator)
DatePicker datePicker = new DatePicker("//input[@id='datePicker']");
datePickerLocator
- the calendar field locator, not the widgetpublic DatePicker(String datePickerLocator, String controlName)
datePickerLocator
- the calendar field element locator, not the widgetcontrolName
- the control name used for loggingpublic DatePicker(ParentTraits parent, String datePickerLocator)
parent
- - A ParentTraits
object that represents the parent element for this element.datePickerLocator
- - the calendar field element locator, not the widget.public DatePicker(String datePickerLocator, String controlName, ParentTraits parent)
datePickerLocator
- the calendar field element locator, not the widgetcontrolName
- the control name used for loggingparent
- - A ParentTraits
object that represents the parent element for this element.public DatePicker(String datePickerLocator, String prevMonthLocator, String nextMonthLocator, String dateTextLocator)
datePickerLocator
- calendar field locator, not the widgetprevMonthLocator
- calendar widget prev monthnextMonthLocator
- calendar widget next monthdateTextLocator
- calendar widget month and year textpublic void clickNextMonth()
public void clickPrevMonth()
public void clickDay(int dayOfMonth)
dayOfMonth
- day to select from calendar widgetpublic String getDateText()
public void setDate(Calendar to)
to
- destination date as Java Calendar format.public void setDate(String date)
date
- string input date format of "MM/dd/yyyy"public void setDate(int year, int month, int day)
year
- The full year.month
- The month. (0-based, 0 for January)day
- The day of the month.public String getDate()
public String getMonth()
public String getYear()
public String getDayOfMonth()
public void datePickerInit(String prevMonthLocator, String nextMonthLocator, String dateTextLocator)
prevMonthLocator
- calendar widget prev monthnextMonthLocator
- calendar widget next monthdateTextLocator
- calendar widget month and year textpublic void reset()
Copyright © 2016 PayPal Open Source. All rights reserved.