Not able to call onclick datepicker function python selenium

0 votes

I'm trying to pass the values into the form. It is passing the values in the normal text box, I couldn't succeed in the onclick datepicker function

Below is the code:

import urllib

from selenium import webdriver

from selenium.webdriver.support.ui import Select

from selenium.webdriver.common.keys import Keys

driver = webdriver.PhantomJS(executable_path="C://Users//phantomjs//bin//phantomjs.exe")

driver.get('https://enquiry.icegate.gov.in/enquiryatices/sbTrack')

select = Select(driver.find_element_by_name('sbTrack_location'))

select.select_by_value("MUNDRA SEA (INMUN1)")

sb_no = driver.find_element_by_name("SB_NO")

sb_no.send_keys(7353156)

sb_dt = driver.find_element_by_name("SB_DT")

sb_dt.send_keys("2017/07/14")

driver.save_screenshot("test1_scr.png")

I am unable to send keys to tag with readonly input property from here.

<input type="text" name="SB_DT" value="" readonly="readonly" id="sbDATE">
Jun 8, 2018 in Selenium by Martin
• 4,210 points
567 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

To pass customized dates e.g. 2017/07/14. You have to remove the attribute readonly="readonly" and then send the date as text as follows:

sb_dt = driver.find_element_by_xpath("//input[@id='sbDATE']")

driver.execute_script("arguments[0].removeAttribute('readonly')", sb_dt);

sb_dt.send_keys("2017/07/14")

answered Jun 8, 2018 by Samarpit
• 5,130 points

Related Questions In Selenium

0 votes
1 answer

Not able to identify datepicker in chrome for my site "tui.co.uk".

Dear Vamshi, After clicking on the date box ...READ MORE

answered Jun 20, 2018 in Selenium by walter 123
• 240 points
41 views
0 votes
1 answer

Not able to open a new URL in a new tab in Selenium

There is a bug in ChromeDriver that ...READ MORE

answered May 21, 2018 in Selenium by Meci Matt
• 9,400 points
4,562 views
0 votes
1 answer

i am not able to perform this method in selenium driver.get("google")

Hi Sachin, are you getting any errors ...READ MORE

answered 4 days ago in Selenium by Abha
• 5,480 points
15 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,030 points
51 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
413 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
40 views
0 votes
1 answer

Not able to login using selenium webdriver using Java Language

Try to send text to the username ...READ MORE

answered Jul 17, 2018 in Selenium by Samarpit
• 5,130 points
191 views
0 votes
1 answer

How to login a forum using Selenium with Python

You should try to directly log in ...READ MORE

answered Apr 27, 2018 in Selenium by Samarpit
• 5,130 points
149 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.