How do I send value to a date picker in Robot Framework?

耗尽温柔 提交于 2019-12-08 04:55:09

问题


I am trying to automate form filling using robot framework. Could pass values to text fields, drop down list etc, stuck at date. Anyone who has done please help.


回答1:


You can send, e.g. a date 6 days from today, directly by setting the value of the datepicker element with javascript:

${my_date_to_select}= Get Current Date    UTC    6 days   %d/%m/%Y
Execute JavaScript  document.getElementById('ID_OF_YOUR_DATEPICKER').value='${my_date_to_select}'

NB: In order to use the keyword 'Get Current Date', you need to add the library DateTime in your settings.




回答2:


Focus        jquery=[name=expDate]
Press Key    jquery=[name=expDate]    09255639


来源:https://stackoverflow.com/questions/27415347/how-do-i-send-value-to-a-date-picker-in-robot-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!