Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to pick date from datepicker in selenium

((JavascriptExecutor)driver).executeScript("document.getElementById('fromDate').setAttribute('value','10 Jan 2013')")
Comment

how to pick date from datepicker in selenium

((JavascriptExecutor)driver).executeScript ("document.getElementById('fromDate').removeAttribute('readonly',0);"); // Enables the from date box

WebElement fromDateBox= driver.findElement(By.id("fromDate"));
fromDateBox.clear();
fromDateBox.sendKeys("8-Dec-2014"); //Enter date in required format
Comment

date picker in selenium

Some date pickers allow you to type. In this case we can 
just use sendKeys method to enter the date we want.

If that does not work, we need to write our logic 
for this using java and selenium. 
1. Click on the field to trigger the date picker
2. Get the displayed date on the date picker and calculate
how many times you need to click left/right
to go to the right month/year. 
3. Once we go to the correct month/year, select the date.
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to access data in json format using asp.net c# 
Javascript :: date compare in js 
Javascript :: === javascript 
Javascript :: how to add icons in angular 
Javascript :: js check if map contains key 
Javascript :: javascript array sorting 
Javascript :: how to copy array of objects in javascript 
Javascript :: javascript count number of clicks limit 
Javascript :: node cache 
Javascript :: array.flat 
Javascript :: Upload different files in different folders using Multer in NodeJs 
Javascript :: prettier printWidth 
Javascript :: enzyme react 
Javascript :: convert date to ist format javascript 
Javascript :: react bootstrap navbar align right buttons 
Javascript :: ng2 validations angular using reactiveforms 
Javascript :: javascript array iteration methods 
Javascript :: connect to existing collection mongoose 
Javascript :: add word in string in javascript 
Javascript :: cut and paste element js 
Javascript :: node js mongoose text index 
Javascript :: send audio with socket io node js 
Javascript :: randomize an array 
Javascript :: sort in array in javascript 
Javascript :: javascript sign 
Javascript :: discord.js create channel and get id 
Javascript :: javascript pop object from array 
Javascript :: nodejs mysql query 
Javascript :: jquery camera priview 
Javascript :: remove last character of string in javascript 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =