Hi How to pass variable instead of value in JavascriptExecutor, Below code is not working for me: firstname= randomstring(); jse.executeScript("document.getElementById('name').value=firstname");
Hello Krishna- Thanks for detailed steps. Can you please explain how to replace dynamic value in the place of hardcoded date value. I need details for how to assign the variable to value field instead of hardcoded value. I tried assign variable in the place of hardcoded date field but not working. can you please help me. js.executeScript("document.getElementById('datepicker1).value='Aug 24 2020 - 07:30 AM'");
If we have id or css selector then below are the ways to handle ---id of an element --- JavascriptExecutor js = (JavascriptExecutor)driver; js.executeScript("document.getElementById('datepicker1').value = '09/12/2020';"); ---- css selector of an element ------- JavascriptExecutor js = (JavascriptExecutor)driver; js.executeScript("document.querySelector('#datepicker1').value='09/12/2020';"); If an element having only name or class (i want to use xpath) then below code is right or not ? Please reply and provide syntax too............. js.executeScript("document.getElementByName('#datepicker1').value='09/12/2020';"); js.executeScript("document.getElementByClass('#datepicker1').value='09/12/2020';"); js.executeScript("document.queryXpath('#datepicker1').value='09/12/2020';");
Complex problem solved simply. Saw several videos but this made it so easy.Thanks
Great to hear!
Please subscribe to the channel and keep visiting ... :)
Thanks.The best available solution on youtube.
Wow, thanks!, Please subscribe to the channel and keep visiting😀
Thanks. i tried this method on TripAdvisor website and it worked perfectly.
Thanku so such... It worked perfectly.. A very simple yet effective solution
Most welcome 😊, Please subscribe to the channel and keep visiting😀
thanks a lot .....no word to say how easy you explain it
Thanks for the feedback *dr.gogo Goyal*
Please subscribe to the channel and keep visiting... :)
Perfect , Great , Thank u
Your a life saver, many thanks!!
You are welcome .
Please subscribe to the channel and keep visiting ... :)
It worked for me, thanks for sharing
I have this html
Mon 6/11/2018
i am unable to access please help
other question is how do i select multiple dates when its disabled date pickers ?
Hello Krishna Sakinala. I am not able to open your website www.automationtesting.in due to this error
Error establishing a database connection
Thank you Sir for this video
Hi
How to pass variable instead of value in JavascriptExecutor,
Below code is not working for me:
firstname= randomstring();
jse.executeScript("document.getElementById('name').value=firstname");
Hello Krishna- Thanks for detailed steps. Can you please explain how to replace dynamic value in the place of hardcoded date value.
I need details for how to assign the variable to value field instead of hardcoded value. I tried assign variable in the place of hardcoded date field but not working. can you please help me.
js.executeScript("document.getElementById('datepicker1).value='Aug 24 2020 - 07:30 AM'");
Krishna could you please make a video on handling tree view using selenium
Thank you sir
we need to check every functionality like month date and year that time how can we do
Thank you
If we have id or css selector then below are the ways to handle
---id of an element ---
JavascriptExecutor js = (JavascriptExecutor)driver; js.executeScript("document.getElementById('datepicker1').value = '09/12/2020';");
---- css selector of an element -------
JavascriptExecutor js = (JavascriptExecutor)driver; js.executeScript("document.querySelector('#datepicker1').value='09/12/2020';");
If an element having only name or class (i want to use xpath) then below code is right or not ? Please reply and provide syntax too.............
js.executeScript("document.getElementByName('#datepicker1').value='09/12/2020';");
js.executeScript("document.getElementByClass('#datepicker1').value='09/12/2020';");
js.executeScript("document.queryXpath('#datepicker1').value='09/12/2020';");
how we solve the same problem in vba excel with seleniom plz tell me
can the date selection be done using chrome browser ? i have checked many videos but all use firefox browser.
Per my knowledge it will work irrespective of browser. Please check once...
Krishna Sakinala... I have been trying the same, but the xpath I'm getting from any date is not working.
Xpath may not work. Use CSSSelector. In JavaScriptExecutor xpath will not work.
Krishna Sakinala can u plz share code with css selector and JavaScript.
how you will select the current date in calendar every time,,none of the youtubers explained this?
its not working for me . giving error"unknown error: document.getElementByID is not a function" please help
Sir, please explain how to automate 2nd type of date picker(DatePicker Enabled)
Use SendKeys() method.
what if we wanna pass date from somewhere else
Please fix it as early as possible.