datepicker selenium javascipt using - node.js

To automate a datepicker, I tried using element.setvalue("12/12/2021")
Has anyone tried the datepicker by clicking on the dates on the modal using javascript? Do you start selecting the year and then click on the arrows for month?

The datepicker has an input element which you can fill text on. This is my code:
Actions actions = new Actions(driver);
actions.moveToElement(element);
actions.click();
actions.sendKeys(pickupDateTime);
actions.build().perform();
And then sendKeys "Enter" to close datePicker.
inputElement.sendkeys(Keys.ENTER);

Related

Select button on webpage selenium VBA

I am trying to automate a web page which has about 50 select buttons and here's an example
<input type="button" value="اختر" onclick="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView1','Select$2')">
The part which is 'Select$2' is what changes from a button to another .. How can I specify the xpath of such a button?
I could select all the buttons using this
//input[#type='button']
But I would like to select specific button.
If you want to use unique part of onclick attribute as locator try
//input[#type='button' and contains(#onclick, 'Select$2')]

how to select a button in highcharts-range selector row and click

I am trying to get data from the following page. However, I would like to check if the range All is selected before getting the data. I am unable to get this because the highcharts element XPATH keeps changing.
The page is
http://www.4-traders.com/APPLE-4849/charts-historical/
How do I select the element and click on it so that I can get all the data.
I am using python and selenium (Chrome Driver)
Regards
You can do this before you download the data. This will loop through the buttons available in highchart and click on it when 'All' text is found.
buttons = driver.find_elements_by_css_selector(".highcharts-button-box")
for button in buttons:
if button.text == 'All':
button.click()
break
#code to download data

Python 3.5 :Simulate dropdown for combobox

I want the values of the combobox to get listed as soon as some text is typed in the combobox without clicking the arrow button.Is there any way i can simulate this arrow click ?

Excel VBA internet explorer automation to create a Google Calendar event

I'm trying to automate the process of booking appointments into Google calendar through excel VBA.
I can open internet explorer but I can't get it to click on the (RED) "CREATE" button to allow me to enter my data and variables from excel.
I was trying to use GetElementByID() but couldn't find the ID in the source code.
Hope to hear from someone as this has really stumped me this time and I don't like being beaten by a challenge.
I just figured this out for myself today after two months of trying to figure it out. For some reason, looping through the div elements to find "Create" innerText and then click it doesn't work. However, the item index of the div container is 180 and if you specify that, then you can click it.
So here's the code that will click the "Create" button.
ie.document.getElementsByTagName("div").Item(180).Click

Javascript Calendar popup from ribbon button

Does anyone have any examples of a calendar popup that can be triggered using a ribbon button on a form?
I'm looking to have a popup where the user can select a date from the calendar which will then pass the value back to the javascript that launched it. I've seen that this can be done from a html popup but my efforts to create this so far haven't really been successful, so was hoping someone could advise me on the best solution.
Thanks
I've managed to find a good calendar that I have used for this solution. It can be found at https://github.com/dbushell/Pikaday
With this I put it into a html popup that had a text box on it (which would store the selected date) and had the javascript on my ribbon button show the popup.
The download includes the js files for the calendar to function and with a little tweaking of these you can make the calendar appear immediately on opening of the popup and not hide when a date is selected. Plus the text box can have its options changed so that it isn't visible to the user.
All put together this creates a rather pleasant looking calendar popup
You can use the date parameter type from html without using javascript
<input type=date >

Resources