Issue
I can change date on web page if I use internet explorer with below code(code1). however, I changed browser to chrome with selenium. (as code 2), date section on web page is changed but it is partial. for example: date is set 18/02/2020 on web page when it is opened. then I want to change date as 01/03/2017 but it is changed to 03/02/2017. that means, month section in macro shanged the date section, nothing changed on month section and year section is also changed
i have tried to change date order in macro like mm/dd/yyyy but ı cant get a proper date solution. just tried millions of code and still cannot find anything.
so please help me to change date section on chrome with using selenium. Sheet1.Range("A1") = 01/03/2017 Code1
ie.document.getElementsByName("date$From")(0).Value = Sheet1.Range("A1").Text
Code2 (selenium and VBA)
obj.FindElementById("date_From").SendKeys (sheet1.Range("A1")).Text
Website code (website is behind a firewall)
<input name="date$From" type="text" value="18/02/2020" size="6" id="date_tbFrom" class="searchSelect">
<input type="hidden" name="date_From_Client" id="date_From_Client">
Solution
found a solution bymelf with try it. I used tab button usage to reach date section and used date format as 01,01,2021. used comma (,) instead of slash (/) as date seperator.
obj.FindElementByName("date$From").Clear
obj.FindElementById("place_before_date").Click
obj.SendKeys (keys.Tab)
obj.FindElementById("date$From").SendKeys (Sheet1.Range("A" & x))
Answered By - SelpaqM
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.